From d38c207c3253094371ab0227dc308fd4b1c32b10 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 17 Apr 2011 21:16:58 -0500 Subject: [svn-r20538] Description: Update with new warning flags for gcc 4.6.x Tested on: FreeBSD/32 8.2 (loyalty) w/gcc 4.6 FreeBSD/64 8.2 (freedom) w/gcc 4.6 --- config/gnu-flags | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index 96db51d..2ef29e5 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -180,10 +180,10 @@ esac # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in -# Closer to the gcc 4.6 release, we should check for additional flags to +# Closer to the gcc 4.7 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.[56]*) + gcc-4.[67]*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" @@ -236,7 +236,71 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS="$H5_CFLAGS -Wjump-misses-init -Wunsuffixed-float-constants -Wunused-result" + H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wc++0x-compat -Wjump-misses-init -Wunsuffixed-float-constants" + + # Append more extra warning flags that only gcc 4.6+ know about + H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" + + # 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.5*) + # 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... + # (this warning was removed in gcc 4.5+) + #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" + + # Append more extra warning flags that only gcc 4.5+ know about + H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wc++0x-compat -Wjump-misses-init -Wunsuffixed-float-constants" # 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 -- cgit v0.12