diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-13 04:55:44 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-13 04:55:44 (GMT) |
commit | 970fcd54e0693dafa78f567639a99cf059fa1425 (patch) | |
tree | e9edcd76f9840357d95663630431727f4e8873b3 /config | |
parent | c7ad57374b5a3633e32a6675a8ca8345d626aaba (diff) | |
download | hdf5-970fcd54e0693dafa78f567639a99cf059fa1425.zip hdf5-970fcd54e0693dafa78f567639a99cf059fa1425.tar.gz hdf5-970fcd54e0693dafa78f567639a99cf059fa1425.tar.bz2 |
[svn-r15212] Description:
Bring back revision 15211 from trunk:
Update the gcc flags for version 4.3
Clean up warnings
Tested on:
Mac OS X/32 10.5.3 (amazon)
Diffstat (limited to 'config')
-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. |