summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-04-23 17:31:34 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-04-23 17:31:34 (GMT)
commitb1f8b21130a4f95d2dcd4b9343ed05e93c33f35c (patch)
tree16640620642ea58c2946ff104777ab5845731a29 /config
parentbfc195feba4d1ac0c3420a039c353d2ae4ab8ce7 (diff)
downloadhdf5-b1f8b21130a4f95d2dcd4b9343ed05e93c33f35c.zip
hdf5-b1f8b21130a4f95d2dcd4b9343ed05e93c33f35c.tar.gz
hdf5-b1f8b21130a4f95d2dcd4b9343ed05e93c33f35c.tar.bz2
[svn-r16845] Description:
Updated with new warning flags from gcc 4.4 Tested: FreeBSD/64 6.3 (liberty) w/gcc 4.4.0
Diffstat (limited to 'config')
-rw-r--r--config/gnu-flags61
1 files changed, 59 insertions, 2 deletions
diff --git a/config/gnu-flags b/config/gnu-flags
index c99a664..fe3eba3 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -190,10 +190,67 @@ esac
# the information from the previous version and adding modifications to that.
case "$cc_vendor-$cc_version" in
-# Closer to the gcc 4.4 release, we should check for additional flags to
+# Closer to the gcc 4.5 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.[34]*)
+ gcc-4.[45]*)
+ # 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 appears to be reliable now...
+ 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"
+
+ # 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 -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"
+
+ # Append more extra warning flags that only gcc 4.2+ know about
+ H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow"
+
+ # 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 -Wlarger-than=2048 -Wvla"
+
+ # Append more extra warning flags that only gcc 4.4+ know about
+ H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
+
+ # 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.3*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"