Commit f6ae96d4 authored by Guilhem Bichot's avatar Guilhem Bichot

BUG#57933 "add -Wdeclaration-after-statement to gcc builds";

first part, for autotools build.

config/ac-macros/maintainer.m4:
  Add the flag. With it, and as we use -Werror, we nicely get
  "error: ISO C90 forbids mixed declarations and code" if
  a declaration follows a statement in C code.
  Note that g++ refuses this flag.
parent 7b2e0723
...@@ -19,6 +19,7 @@ AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [ ...@@ -19,6 +19,7 @@ AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
AS_IF([test "$GCC" = "yes"], [ AS_IF([test "$GCC" = "yes"], [
C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror" C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter" CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
C_WARNINGS="${C_WARNINGS} -Wdeclaration-after-statement"
]) ])
# Test whether the warning options work. # Test whether the warning options work.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment