Skip to content

Commit

Permalink
GCC stringop bug
Browse files Browse the repository at this point in the history
- FMT will trigger a gcc bug on stringop-overflow with gcc versions 11 and earlier
- FMT issue fmtlib/fmt#2442
- FMT issue fmtlib/fmt#2708
- GCC bug tracker https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854
- Confirming it still appears on gcc-11 https://godbolt.org/z/d15q4Exvz
  • Loading branch information
dr7ana committed Jun 4, 2024
1 parent 88aba0c commit e99a6fc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ if (WARNINGS_AS_ERRORS)
endif()
add_library(libquic_internal-warnings INTERFACE)

if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0)
target_compile_options(libquic_internal-warnings INTERFACE -fconcepts)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0)
target_compile_options(libquic_internal-warnings INTERFACE -fconcepts)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0.0)
list(APPEND warning_flags -Wno-error=stringop-overflow) # gcc 11 and earlier bug
endif()
endif()

target_compile_options(libquic_internal-warnings INTERFACE "$<$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:C>>:${warning_flags}>")
Expand Down

0 comments on commit e99a6fc

Please sign in to comment.