Skip to content

Commit 0ca98d2

Browse files
committed
Enable additional warnings with GCC/Clang to match Visual Studio
1 parent 85155f1 commit 0ca98d2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
7878
# Enable lots of warnings
7979
set(CMAKE_CXX_FLAGS
8080
"${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Werror -Wswitch-enum \
81+
-Wextra -Wconversion \
8182
-Wno-deprecated-declarations -Wno-maybe-uninitialized")
8283
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
8384
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
@@ -86,7 +87,9 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
8687
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
8788
# Enable lots of warnings
8889
set(CMAKE_CXX_FLAGS
89-
"${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Werror -Wswitch-enum -Wno-deprecated-declarations")
90+
"${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Werror -Wswitch-enum \
91+
-Wextra -Wconversion \
92+
-Wno-deprecated-declarations")
9093
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
9194
# This would be the place to enable warnings for Windows builds, although
9295
# config.inc doesn't seem to do that currently

Diff for: src/config.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ifeq ($(BUILD_ENV),MSVC)
5252
CXXFLAGS += /wd4619
5353
else
5454
CXXFLAGS += -Wall -pedantic -Werror -Wswitch-enum
55-
CXXFLAGS += -Wno-deprecated-declarations
55+
CXXFLAGS += -Wno-deprecated-declarations -Wextra -Wconversion
5656
# GCC only, silence clang warning
5757
CXXFLAGS += -Wno-maybe-uninitialized -Wno-unknown-warning-option
5858
endif

0 commit comments

Comments
 (0)