Skip to content

Commit

Permalink
Silence warnings from preprocessor by gcc < 13
Browse files Browse the repository at this point in the history
The 'GCC diagnostic' in
src/IO/Exporter/Exporter.cpp
is not respected by gcc < 13, so we have to
disable the warning.
Upstream bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
  • Loading branch information
nilsvu committed Sep 9, 2024
1 parent 87415e5 commit 21990de
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmake/EnableWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ target_link_libraries(
SpectreWarnNoNoexceptType
)

# GCC versions below 13 don't respect 'GCC diagnostic' pragmas to disable
# warnings by the preprocessor:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
# So we disable the warning about unknown pragmas because we can't silence it.
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
create_cxx_flag_target("-Wno-unknown-pragmas" SpectreWarnNoUnknownPragmas)
target_link_libraries(
SpectreWarnings
INTERFACE
SpectreWarnNoUnknownPragmas
)
endif()

target_link_libraries(
SpectreFlags
INTERFACE
Expand Down

0 comments on commit 21990de

Please sign in to comment.