Skip to content

Commit 241a2cb

Browse files
committed
Enable more warnings
1 parent 2467cc7 commit 241a2cb

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

cmake/configure.cmake

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,25 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" )
2121
set( CMAKE_CXX_STANDARD 20 )
2222

2323
if( UNIX )
24-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
25-
-Wall -Wextra \
26-
-Wno-unused-parameter \
27-
-Wno-cast-function-type \
28-
-Wsign-compare -Werror")
29-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
30-
-Wall -Wextra \
24+
set(COMMON_COMPILER_FLAGS
25+
"-Wall -Wextra \
26+
-Wpedantic \
27+
-Wpointer-arith \
28+
-Wcast-align \
29+
-Wwrite-strings \
30+
-Wswitch-enum \
3131
-Wno-unused-parameter \
3232
-Wno-cast-function-type \
33+
-Wnull-dereference \
34+
-Wold-style-definition \
35+
-Wswitch-enum \
36+
-Wformat=2 \
37+
-Wmissing-prototypes \
38+
-Wmissing-declarations \
39+
-Wno-c11-extensions \
3340
-Wsign-compare -Werror")
41+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILER_FLAGS}")
42+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILER_FLAGS}")
3443
if (USE_COVERAGE)
3544
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
3645
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")

0 commit comments

Comments
 (0)