Skip to content

Commit 8af4342

Browse files
committed
Make void* arithmetic fail the build for debug builds
1 parent 3882892 commit 8af4342

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ endif()
149149

150150
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
151151
# Treat warnings as errors with some exceptions
152-
set(GCC_FLAGS "-Wall -Werror -Wno-deprecated-declarations")
152+
set(GCC_FLAGS "-Wall -Werror -Wno-deprecated-declarations -Werror=pointer-arith")
153153
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_FLAGS} -Wno-class-memaccess -Wno-array-compare -Wno-unused-result -Wno-maybe-uninitialized")
154154
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_FLAGS} -Wno-discarded-qualifiers")
155155
# The following showed up in GCC 14, which I am using via msys2 on Windows.

0 commit comments

Comments
 (0)