Skip to content

Commit

Permalink
cflags: add -Wdeclaration-after-statement
Browse files Browse the repository at this point in the history
This allows people working on the code to spot the
most common error that breaks the MSVC build

Signed-off-by: Steve Markgraf <[email protected]>
  • Loading branch information
steve-m committed Jan 24, 2014
1 parent c25f9cb commit be8716b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit be8716b

Please sign in to comment.