Skip to content

Commit

Permalink
Allow some warnings for gcc 13.0 and 13.1
Browse files Browse the repository at this point in the history
There are false positive warnings for

- stringop-overflow
- array-bounds

that don't seem to be suppressible using Pragmas.  From what I can tell, they occur on gcc
13.1 but not gcc 13.2.  Sadly, gcc 13.1 is the latest version of gcc that is available on
Ubuntu 22.04, so this would imply being stuck on a really old gcc version in the CI where
we use -Werror.

This commit prevents these two warnings from being treated as errors, but only if it is
gcc 13.0 or gcc 13.1.  That way the risk of not treating them as errors should be
minimized.

Signed-off-by: Erik Boasson <eb@ilities.com>
  • Loading branch information
eboasson committed Mar 27, 2024
1 parent 0f07fe7 commit 1c073c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -134,6 +134,10 @@ elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
if(${WERROR})
add_compile_options(-Werror)
add_link_options(-Werror)
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 13.2)
add_compile_options(-Wno-error=stringop-overflow -Wno-error=array-bounds)
add_link_options(-Wno-error=stringop-overflow -Wno-error=array-bounds)
endif()
endif()
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
add_compile_options(-fdiagnostics-color=always)
Expand Down

0 comments on commit 1c073c1

Please sign in to comment.