build: disable restrict warning when using GCC 12.1-12.3
Prevents warning raised by a compiler bug when using GCC 12.1-12.3 with C++20 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105545
This commit is contained in:
@@ -30,6 +30,7 @@ Changes from ns-3.40 to ns-3-dev
|
||||
|
||||
* In preparation to enable C++20, the following actions have been taken due to compiler issues:
|
||||
* Precompiled headers have been disabled in GCC versions >= 12.2.
|
||||
* The `restrict` warning has been disabled in GCC versions 12.1-12.3.1.
|
||||
|
||||
### Changed behavior
|
||||
|
||||
|
||||
@@ -251,6 +251,13 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||
CACHE BOOL "Precompile module headers to speed up compilation" FORCE
|
||||
)
|
||||
endif()
|
||||
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1.0")
|
||||
AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.3.2")
|
||||
)
|
||||
# Disable warnings-as-errors for certain versions of GCC when C++20 is
|
||||
# enabled https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105545
|
||||
add_compile_options(-Wno-restrict)
|
||||
endif()
|
||||
set(GCC TRUE)
|
||||
add_definitions(-fno-semantic-interposition)
|
||||
if(${NS3_COLORED_OUTPUT} OR "$ENV{CLICOLOR}")
|
||||
|
||||
Reference in New Issue
Block a user