From acbdf8e791dfd035825b86f9ae7484be5abe5816 Mon Sep 17 00:00:00 2001 From: Sergey Kanaev Date: Thu, 31 Mar 2022 10:19:59 +0300 Subject: [PATCH] [NFC][SYCL] Fix static analysis warning Signed-off-by: Sergey Kanaev --- sycl/source/detail/posix_pi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sycl/source/detail/posix_pi.cpp b/sycl/source/detail/posix_pi.cpp index 48b172c2f8f9d..de422883afb56 100644 --- a/sycl/source/detail/posix_pi.cpp +++ b/sycl/source/detail/posix_pi.cpp @@ -22,8 +22,9 @@ void *loadOsLibrary(const std::string &PluginPath) { // RTLD_DEEPBIND option when there are multiple plugins. void *so = dlopen(PluginPath.c_str(), RTLD_NOW); if (!so && trace(TraceLevel::PI_TRACE_ALL)) { + char *Error = dlerror(); std::cerr << "SYCL_PI_TRACE[-1]: dlopen(" << PluginPath << ") failed with <" - << dlerror() << ">" << std::endl; + << (Error ? Error : "unknown error") << ">" << std::endl; } return so; }