Skip to content

Commit f4cb0f9

Browse files
Copilotstefanatwork
authored andcommitted
Fix -Warith-conversion incompatibility with GCC < 10 on Rocky Linux 8
1 parent e185f88 commit f4cb0f9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

common/cmake/gnu.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wrestrict") # warn abo
4848
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshift-overflow=2") # warn about undefined shift behavior
4949
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Walloc-size-larger-than=9223372036854775807") # warn about allocation exceeding max object size
5050
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstringop-overflow") # warn about buffer overflow in string operations
51-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Warith-conversion") # warn about implicit arithmetic conversions
51+
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "10.0")
52+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Warith-conversion") # warn about implicit arithmetic conversions (GCC 10+)
53+
ENDIF()
5254
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cast-align") # disable: intentional aligned loads in SIMD code
5355
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-declarations") # disable: intentional factory pattern without declarations
5456
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-shadow") # disable: pervasive in vector class constructors

0 commit comments

Comments
 (0)