2005-02-07 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Mon, 7 Feb 2005 22:03:12 +0000 (22:03 -0000)
committerZoltan Varga <vargaz@gmail.com>
Mon, 7 Feb 2005 22:03:12 +0000 (22:03 -0000)
* configure.in: Add -Wdeclaration-after-statement option to CFLAGS if
gcc supports it to weed out pre ISO C99 code.

svn path=/trunk/mono/; revision=40272

ChangeLog
configure.in

index 1724de5807927360720905826101424acd19546d..1d94c778093a414039ca95e03e0cd180087153eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
+
+       * configure.in: Add -Wdeclaration-after-statement option to CFLAGS if
+       gcc supports it to weed out pre ISO C99 code.
+
 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
 
        * data/net_1_1/DefaultWsdlHelpGenerator.aspx:
index 4ab61d28ded25f4cc2984a1cf7b7a4c1aeec84ad..64395dd9b3915312cc9adf47deccb87f9ce8c13b 100644 (file)
@@ -272,6 +272,18 @@ if test x"$GCC" = xyes; then
         WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
                # The runtime code does not respect ANSI C strict aliasing rules
                CFLAGS="$CFLAGS -fno-strict-aliasing"
+
+               ORIG_CFLAGS=$CFLAGS
+               CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+               AC_MSG_CHECKING(for -Wdeclaration-after-statement option to gcc)
+               AC_TRY_COMPILE([], [
+                                                  void main () { }
+               ], [
+                  AC_MSG_RESULT(yes)
+               ], [
+                  AC_MSG_RESULT(no)
+                  CFLAGS=$ORIG_CFLAGS
+               ])
 else
        # The Sun Forte compiler complains about inline functions that access static variables
        # so disable all inlining.