From 02e6c3932b224f7a088f7e7a49f211dd263cfbc0 Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Tue, 3 Mar 2015 19:25:42 +0100 Subject: [PATCH] build: enable more warnings for gcc Enable implicit-function-declaration and redundant-decls warnings when compiling with gcc. redundant-decl useful for exported headers. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3626aee0e..81e5af13f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,6 +175,14 @@ if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format") endif() endif() + CHECK_C_COMPILER_FLAG (-Wimplicit-function-declaration Wimplicit-function-declaration) + if(Wimplicit-function-declaration) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wimplicit-function-declaration") + endif() + CHECK_C_COMPILER_FLAG (-Wredundant-decls Wredundant-decls) + if(Wredundant-decls) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wredundant-decls") + endif() if(CMAKE_BUILD_TYPE STREQUAL "Release") set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG")