diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-13 04:52:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-13 04:52:22 (GMT) |
commit | 97b6832023ceb7665750de6a0adb3e67c5961df2 (patch) | |
tree | f8894636f01d284a508925d3f165a6b246606295 /config/gnu-flags | |
parent | 97e6dc5d876d4e772fd65727f6b9b2c4367cb080 (diff) | |
download | hdf5-97b6832023ceb7665750de6a0adb3e67c5961df2.zip hdf5-97b6832023ceb7665750de6a0adb3e67c5961df2.tar.gz hdf5-97b6832023ceb7665750de6a0adb3e67c5961df2.tar.bz2 |
[svn-r15211] Description:
Update the gcc flags for version 4.3
Clean up warnings
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.5.3 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'config/gnu-flags')
-rw-r--r-- | config/gnu-flags | 81 |
1 files changed, 66 insertions, 15 deletions
diff --git a/config/gnu-flags b/config/gnu-flags index 401bafe..bb8d27c 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -138,7 +138,7 @@ case "$cc_vendor-$cc_version" in esac # General - H5_CFLAGS="$H5_CFLAGS $arch -ansi -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline" + H5_CFLAGS="$H5_CFLAGS $arch -ansi -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline" # Production case "$cc_vendor-$cc_version" in @@ -187,7 +187,7 @@ case "$cc_vendor-$cc_version" in # Closer to the gcc 4.4 release, we should check for additional flags to # include and break it out into it's own section, like the other versions # below. -QAK - gcc-4.[123]*) + gcc-4.[3]*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" @@ -202,13 +202,13 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - # Enable mort format checking flags, beyond the basic -Wformat included + # Enable more format checking flags, beyond the basic -Wformat included # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat-nonliteral -Wformat-security -Wformat-y2k" + H5_CFLAGS="$H5_CFLAGS -Wformat=2" - # The "unreachable code" warning does not appear to be reliable yet... + # The "unreachable code" warning appears to be reliable now... H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" # Append warning flags from gcc-3.3* case @@ -221,10 +221,61 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wmissing-field-initializers -Wvariadic-macros" + H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" + + # Append more extra warning flags that only gcc 4.1+ know about + H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wvolatile-register-var" + + # Append more extra warning flags that only gcc 4.3+ know about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wvla" + + # Try out the new "stack protector" feature in gcc 4.1 + # (Strictly speaking this isn't really a "warning" flag, so it's added to + # the debugging flags) + #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" + ;; + + gcc-4.[12]*) + # Replace -ansi flag with -std=c99 flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Disable warnings about using 'long long' type + H5_CFLAGS="$H5_CFLAGS -Wno-long-long" + + # Append warning flags from gcc-3* case + # (don't use -Wpadded flag for normal builds, many of the warnings its + # issuing can't be fixed and they are making it hard to detect other, + # more important warnings) + #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" + + # Append warning flags from gcc-3.2* case + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" + + # Enable more format checking flags, beyond the basic -Wformat included + # in -Wall + H5_CFLAGS="$H5_CFLAGS -Wformat=2" + + # The "unreachable code" warning does not appear to be reliable yet... + H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" + + # Append warning flags from gcc-3.3* case + H5_CFLAGS="$H5_CFLAGS -Wendif-labels" + + # Append warning flags from gcc-3.4* case + H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - # Append more extra warning flags that only gcc4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" + # Replace old -W flag with new -Wextra flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + + # Append more extra warning flags that only gcc 4.0+ know about + H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" + + # Append more extra warning flags that only gcc 4.1+ know about + H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wvolatile-register-var" # Try out the new "stack protector" feature in gcc 4.1 # (Strictly speaking this isn't really a "warning" flag, so it's added to @@ -247,7 +298,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" # The "format=2" warning generates too many warnings about valid # usage in the library. @@ -265,8 +316,8 @@ case "$cc_vendor-$cc_version" in # Replace old -W flag with new -Wextra flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wmissing-field-initializers -Wvariadic-macros" + # Append more extra warning flags that only gcc 4.0+ know about + H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" ;; gcc-3.4*) @@ -284,7 +335,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" # The "format=2" warning generates too many warnings about valid # usage in the library. @@ -318,7 +369,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" # The "format=2" warning generates too many warnings about valid # usage in the library. @@ -346,7 +397,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" # Append more extra warning flags that only gcc3.2+ know about - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" # The "format=2" warning generates too many warnings about valid # usage in the library. |