aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Markgraf <steve@steve-m.de>2014-01-24 17:45:55 +0100
committerSteve Markgraf <steve@steve-m.de>2014-01-24 17:45:55 +0100
commitbe8716b2c82169ffe2d210444115a729e627b550 (patch)
tree3082172375fd15ee38a4429768ee60329e9bd995
parentc25f9cbc38ea1fd9f589a856cfb36d239609f450 (diff)
cflags: add -Wdeclaration-after-statement
This allows people working on the code to spot the most common error that breaks the MSVC build Signed-off-by: Steve Markgraf <steve@steve-m.de>
-rw-r--r--CMakeLists.txt1
-rw-r--r--configure.ac2
2 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f0bd92f..0597600 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,7 @@ if(CMAKE_COMPILER_IS_GNUCC AND NOT WIN32)
ADD_DEFINITIONS(-Wno-unused-parameter)
ADD_DEFINITIONS(-Wno-unused)
ADD_DEFINITIONS(-Wsign-compare)
+ ADD_DEFINITIONS(-Wdeclaration-after-statement)
#http://gcc.gnu.org/wiki/Visibility
add_definitions(-fvisibility=hidden)
endif()
diff --git a/configure.ac b/configure.ac
index ca4bc6f..b60ca81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,7 +62,7 @@ AC_SUBST(SYMBOL_VISIBILITY)
AC_MSG_CHECKING(whether compiler understands -Wall)
old_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-unused -Wsign-compare"
+CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-unused -Wsign-compare -Wdeclaration-after-statement"
AC_TRY_COMPILE([],[],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)