Files
H. Joe LeeandClaude Opus 5 61fbe139e8 Solaris: only pass SunPro -erroff to SunPro compilers (#6570)
On SunOS the C and C++ flag files appended the single string
"-erroff=%none -DBSD_COMP" to HDF5_CMAKE_C/CXX_FLAGS. Because that is one
list element, target_compile_options() hands it to the compiler as one
argument, and -erroff is an Oracle Developer Studio option to begin with.
gcc silently ignores the result (it parses the leading -e as the linker
entry-symbol option), but clang errors out:

  clang: error: unknown argument: '-erroff=%none -DBSD_COMP'

which breaks the build on the first object file. As a side effect,
-DBSD_COMP was never actually reaching the compiler as a define.

Emit -erroff=%none only for SunPro, and append -DBSD_COMP as its own list
element so it is passed as a separate argument on all Solaris compilers.

Fixes #6569

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 14:57:23 -05:00
..