Changeset: 794a4a15bdd7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=794a4a15bdd7
Modified Files:
        configure.ag
Branch: Apr2011
Log Message:

updated & tightened warning & error switches for gcc, clang & icc


diffs (121 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -533,8 +533,66 @@
            X_CFLAGS="$X_CFLAGS -Wdeclaration-after-statement";;
        esac
        X_CFLAGS="$X_CFLAGS -Wundef"
+
+       X_CFLAGS="$X_CFLAGS -Wformat=2 -Wno-format-nonliteral"
+       X_CFLAGS="$X_CFLAGS -Winit-self"
+       X_CFLAGS="$X_CFLAGS -Winvalid-pch"
+       X_CFLAGS="$X_CFLAGS -Wmissing-include-dirs"
+       X_CFLAGS="$X_CFLAGS -Wpacked"
+       X_CFLAGS="$X_CFLAGS -Wstack-protector"
+       X_CFLAGS="$X_CFLAGS -Wunknown-pragmas"
+       X_CFLAGS="$X_CFLAGS -Wvariadic-macros"
+
+       case "$CC" in
+       *clang*)
+               ;;
+       *)
+               dnl clang (2.8) does not know these
+               X_CFLAGS="$X_CFLAGS -Wjump-misses-init"
+               X_CFLAGS="$X_CFLAGS -Wlogical-op"
+               X_CFLAGS="$X_CFLAGS -Wpacked-bitfield-compat"
+               X_CFLAGS="$X_CFLAGS -Wsync-nand"
+
+               dnl these trigger a warning (-> error) with clang (2.8)
+               X_CFLAGS="$X_CFLAGS -Wcast-align"
+               X_CFLAGS="$X_CFLAGS -Wunreachable-code"
+               ;;
+       esac
+
+       dnl  Our code is not (yet?) up to these:
+       dnl X_CFLAGS="$X_CFLAGS -pedantic-errors -Wno-long-long"
+       dnl X_CFLAGS="$X_CFLAGS -Waggregate-return"
+       dnl X_CFLAGS="$X_CFLAGS -Wbad-function-cast"
+       dnl X_CFLAGS="$X_CFLAGS -Wcast-qual"
+       dnl X_CFLAGS="$X_CFLAGS -Wc++-compat"
+       dnl X_CFLAGS="$X_CFLAGS -Wconversion"
+       dnl X_CFLAGS="$X_CFLAGS -Wdisabled-optimization"
+       dnl X_CFLAGS="$X_CFLAGS -Wfloat-equal"
+       dnl X_CFLAGS="$X_CFLAGS -Winline"
+       dnl X_CFLAGS="$X_CFLAGS -Wmissing-declarations"
+       dnl X_CFLAGS="$X_CFLAGS -Wmissing-format-attribute"
+       dnl X_CFLAGS="$X_CFLAGS -Wmissing-noreturn"
+       dnl X_CFLAGS="$X_CFLAGS -Wmissing-prototypes"
+       dnl X_CFLAGS="$X_CFLAGS -Wnested-externs"
+       dnl X_CFLAGS="$X_CFLAGS -Wold-style-definition"
+       dnl X_CFLAGS="$X_CFLAGS -Woverlength-strings"
+       dnl X_CFLAGS="$X_CFLAGS -Wpadded"
+       dnl X_CFLAGS="$X_CFLAGS -Wredundant-decls"
+       dnl X_CFLAGS="$X_CFLAGS -Wshadow"
+       dnl X_CFLAGS="$X_CFLAGS -Wsign-conversion"
+       dnl X_CFLAGS="$X_CFLAGS -Wstrict-overflow=5"
+       dnl X_CFLAGS="$X_CFLAGS -Wstrict-prototypes"
+       dnl X_CFLAGS="$X_CFLAGS -Wswitch-default"
+       dnl X_CFLAGS="$X_CFLAGS -Wswitch-enum"
+       dnl X_CFLAGS="$X_CFLAGS -Wtraditional"
+       dnl X_CFLAGS="$X_CFLAGS -Wtraditional-conversion"
+       dnl X_CFLAGS="$X_CFLAGS -Wunsuffixed-float-constants"
+       dnl X_CFLAGS="$X_CFLAGS -Wvla"
+       dnl X_CFLAGS="$X_CFLAGS -Wwrite-strings"
+
        dnl  The default configure invocation when doing an rpmbuild also uses 
this
        X_CFLAGS="$X_CFLAGS -Wp,-D_FORTIFY_SOURCE=2"
+
        dnl  Some versions of bison seem to generate code
        dnl  that does not compile with `gcc -Wundef`;
        dnl  we use GCC_BISON_CFLAGS to disable the respective warning as
@@ -548,17 +606,6 @@
        4.[[3-9]]*-*|[[5-9]].*-*)
            GCC_BISON_CFLAGS="$GCC_BISON_CFLAGS -Wno-unused-function";;
        esac
-       dnl  Our code it not (yet?) up to these:
-       dnl X_CFLAGS="$X_CFLAGS -Wshadow"
-       dnl X_CFLAGS="$X_CFLAGS -Wconversion"
-       dnl X_CFLAGS="$X_CFLAGS -Wstrict-prototypes"
-       dnl X_CFLAGS="$X_CFLAGS -Wold-style-definition"
-       dnl X_CFLAGS="$X_CFLAGS -Wmissing-prototypes"
-       dnl X_CFLAGS="$X_CFLAGS -Wmissing-declarations"
-       dnl X_CFLAGS="$X_CFLAGS -Wmissing-format-attribute"
-       dnl X_CFLAGS="$X_CFLAGS -Wredundant-decls"
-       dnl X_CFLAGS="$X_CFLAGS -Wnested-externs"
-       dnl X_CFLAGS="$X_CFLAGS -Wunreachable-code"
        dnl  ... however, some things are beyond our control:
        case $gcc_ver-$host_os in
        *-solaris*|*-aix*)
@@ -580,6 +627,14 @@
        dnl  as locally as possbile via "-Wno-strict-aliasing 
-Wno-unused-variable -Wno-unused-function -Wno-unused-parameter -Wno-undef 
-Wno-missing-field-initializers"
        dnl  (see also clients/perl/Cimpl/Makefile.ag).
        GCC_SWIG_CFLAGS="$GCC_SWIG_CFLAGS -Wno-strict-aliasing 
-Wno-unused-variable -Wno-unused-function -Wno-unused-parameter -Wno-undef 
-Wno-unused-value"
+       case "$CC" in
+       *clang*)
+               ;;
+       *)
+               dnl clang (2.8) does not know this
+               GCC_SWIG_CFLAGS="$GCC_SWIG_CFLAGS -Wno-logical-op"
+               ;;
+       esac
        case "$gcc_ver-$host_os" in
        [[4-9]].*-*)
            dnl  -Wno-missing-field-initializers is only available as of gcc 4.*
@@ -634,7 +689,7 @@
        *)      CFLAGS="$CFLAGS -ansi";;
        esac
        dnl  Be picky; "-Werror" seems to be too rigid for autoconf...
-       CFLAGS="$CFLAGS -Wall -w2"
+       CFLAGS="$CFLAGS -Wall -w2 -Wcheck"
        dnl  Be rigid; MonetDB code is supposed to adhere to this... ;-)
        dnl  Let warning #266 "function declared implicitly" become an error.
        X_CFLAGS="$X_CFLAGS -we266"
@@ -646,7 +701,7 @@
        X_CFLAGS="$X_CFLAGS -we111"
        dnl  Let remark #271: "trailing comma is nonstandard" become an error.
        X_CFLAGS="$X_CFLAGS -we271"
-       X_CFLAGS="$X_CFLAGS -Werror"
+       X_CFLAGS="$X_CFLAGS -Werror -Werror-all"
        dnl  ... however, some things aren't solved, yet:
        dnl  (for the time being,) we need to disable some warnings (making 
them remarks doesn't seem to work with -Werror):
        X_CFLAGS="$X_CFLAGS -wd1418,1419,981,193,1357"
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to