|
From: <sv...@va...> - 2010-01-01 18:31:14
|
Author: sewardj Date: 2010-01-01 18:30:59 +0000 (Fri, 01 Jan 2010) New Revision: 10984 Log: Don't use -Wdeclaration-after-statement. We long since abandoned any pretense of being buildable with gcc prior to 3.0, hence there's no point in having this flag. Modified: trunk/configure.in Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2010-01-01 12:44:12 UTC (rev 10983) +++ trunk/configure.in 2010-01-01 18:30:59 UTC (rev 10984) @@ -1217,33 +1217,6 @@ fi -# does this compiler support -Wdeclaration-after-statement ? -AC_MSG_CHECKING([if gcc accepts -Wdeclaration-after-statement]) - -safe_CFLAGS=$CFLAGS -CFLAGS="-Wdeclaration-after-statement" - -AC_TRY_COMPILE(, [ - return 0; -], -[ -declaration_after_statement=yes -FLAG_WDECL_AFTER_STMT="-Wdeclaration-after-statement" -AC_MSG_RESULT([yes]) -], [ -declaration_after_statement=no -FLAG_WDECL_AFTER_STMT="" -AC_MSG_RESULT([no]) -]) -CFLAGS=$safe_CFLAGS - -AC_SUBST(FLAG_WDECL_AFTER_STMT) - -if test x$declaration_after_statement = xyes; then - CFLAGS="$CFLAGS -Wdeclaration-after-statement" -fi - - # does this compiler support -Wno-empty-body ? AC_MSG_CHECKING([if gcc accepts -Wno-empty-body]) |
|
From: Bart V. A. <bar...@gm...> - 2010-01-01 18:39:28
|
On Fri, Jan 1, 2010 at 7:31 PM, <sv...@va...> wrote: > Author: sewardj > Date: 2010-01-01 18:30:59 +0000 (Fri, 01 Jan 2010) > New Revision: 10984 > > Log: > Don't use -Wdeclaration-after-statement. We long since abandoned any > pretense of being buildable with gcc prior to 3.0, hence there's no > point in having this flag. Hello Julian, First of all, my best wishes for the new year 2010. Regarding r10984: ANSI C89 and C90 (but not C99) require that declarations come before statements. Giving up -Wdeclaration-after-statement also means giving up C89 and C90 conformance. Bart. |
|
From: Julian S. <js...@ac...> - 2010-01-03 22:47:44
|
Hi, > Giving up > -Wdeclaration-after-statement also means giving up C89 and C90 > conformance. Yes, but that's OK. The point of conforming to C89 was so that V could be build with gcc-2.96 as supplied with Red Hat 7.3, but that's really so ancient now that it's not worth thinking about. gcc-3.0 and later support C99, iiuc, and we'ver required gcc-3.0 as a minimum for a long time. So -Wdeclaration-after-statement is now just a nuisance. J |