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>
remotes/origin/HEAD
Steve Markgraf 2014-01-24 17:45:55 +01:00
rodzic c25f9cbc38
commit be8716b2c8
2 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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()

Wyświetl plik

@ -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)