Skip to content

Commit

Permalink
build: Disable pedantic checks in GCC9 due to extra semicolon check
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabrielcarvfer committed Apr 21, 2024
1 parent a9fb22a commit 4ce1982
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
"GNU ${CMAKE_CXX_COMPILER_VERSION} ${below_minimum_msg} ${GNU_MinVersion}"
)
endif()
if((CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0.0"))
set(GCC_PEDANTIC_SEMICOLON TRUE)
endif()
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.2.0"))
# PCH causes weird errors on certain versions of GCC when C++20 is enabled
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106799
Expand Down
7 changes: 6 additions & 1 deletion build-support/macros-and-definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ macro(process_options)
add_compile_options(/WX)
endif()
else()
add_compile_options(-Wall -Wpedantic) # -Wextra
add_compile_options(-Wall) # -Wextra
# Pedantic checks in GCC < 10 include extra semicolon, which we use a lot
# to make macros look like function calls
if(NOT (DEFINED GCC_PEDANTIC_SEMICOLON))
add_compile_options(-Wpedantic)
endif()
if(${NS3_WARNINGS_AS_ERRORS})
add_compile_options(-Werror -Wno-error=deprecated-declarations)
endif()
Expand Down

0 comments on commit 4ce1982

Please sign in to comment.