unused and set but not used variable warnings when building with toolchain clang on Linux

Baesken, Matthias matthias.baesken at sap.com
Mon Oct 7 14:45:46 UTC 2024


Hi, I came across  some warnings as errors today when trying to build  on Linux with toolchain  clang     (clang 15 on USE Linux)  :


jdk/src/jdk.jpackage/share/native/common/Log.cpp:46:28: error: unused variable 'defaultLogLevel' [-Werror,-Wunused-const-variable]
    const Logger::LogLevel defaultLogLevel = Logger::LOG_TRACE;



jdk/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c:359:11: error: variable 'rslt' set but not used [-Werror,-Wunused-but-set-variable]
      int rslt;



Should we adjust the coding ?
Or somehow silence / remove this warning ?

I wonder where this comes from, last time I built with clang  on Linux I did not see those …


Best regards, Matthias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20241007/255bfd4c/attachment-0001.htm>


More information about the build-dev mailing list