Skip to content

Commit

Permalink
GCC stringop bugfix
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 25909ef commit a98f2ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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)
# gcc 11 and earlier bug
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0.0)
if (libquic_IS_TOPLEVEL_PROJECT)
list(APPEND warning_flags -Wno-error=stringop-overflow)
else()
target_compile_options(libquic_external INTERFACE -Wno-error=stringop-overflow)
endif()
endif()

target_compile_options(libquic_internal-warnings INTERFACE "$<$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:C>>:${warning_flags}>")
Expand Down
2 changes: 1 addition & 1 deletion external/oxen-encoding

0 comments on commit a98f2ff

Please sign in to comment.