Use -Wextra flag with gcc

From the manual:
This enables some extra warning flags that are not enabled by -Wall. (This option used to be called -W. The older name is still supported, but the newer name is more descriptive.)

-Wclobbered
-Wempty-body
-Wignored-qualifiers
-Wimplicit-fallthrough=3
-Wmissing-field-initializers
-Wmissing-parameter-type (C only)
-Wold-style-declaration (C only)
-Woverride-init
-Wsign-compare (C only)
-Wtype-limits
-Wuninitialized
-Wshift-negative-value (in C++03 and in C99 and newer)
-Wunused-parameter (only with -Wunused or -Wall)
-Wunused-but-set-parameter (only with -Wunused or -Wall)
This commit is contained in:
Timothy Rae 2017-03-31 12:22:38 +09:00
parent 4c339031f0
commit b23f2e155f

View File

@ -32,7 +32,7 @@ else (MSVC)
set(CPPLINT_ARG_OUTPUT "--output=eclipse") set(CPPLINT_ARG_OUTPUT "--output=eclipse")
set(CPPCHECK_ARG_TEMPLATE "--template=gcc") set(CPPCHECK_ARG_TEMPLATE "--template=gcc")
# Useful compile flags and extra warnings # Useful compile flags and extra warnings
add_compile_options(-fstack-protector -Wall -Winit-self -Wswitch-enum -Wshadow -Winline) add_compile_options(-fstack-protector -Wall -Wextra -Winit-self -Wswitch-enum -Wshadow -Winline)
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
# GCC flags # GCC flags
if (SQLITECPP_USE_GCOV AND CMAKE_COMPILER_IS_GNUCXX) if (SQLITECPP_USE_GCOV AND CMAKE_COMPILER_IS_GNUCXX)