diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2014-05-21 18:58:19 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2014-05-21 18:58:19 (GMT) |
commit | 6bca0b842933b6676635a6aaf03d8b4c565246e0 (patch) | |
tree | 6c004bd1a07033689507424ade1f8b2487b527e4 /config | |
parent | e5844f4f01f2ead43d1f0647ef22c7eee861da17 (diff) | |
download | hdf5-6bca0b842933b6676635a6aaf03d8b4c565246e0.zip hdf5-6bca0b842933b6676635a6aaf03d8b4c565246e0.tar.gz hdf5-6bca0b842933b6676635a6aaf03d8b4c565246e0.tar.bz2 |
[svn-r25209] Description:
Bring r25206 & r25207 from trunk to 1.8 branch:
r25206:
Add new warning flags for gcc 4.9.x
r25207:
Merge changes from Coverity branch to trunk:
r20907:
Original issue was #338.
Refactored code to clean up allocations consistantly, completely, check all returns, assign initialization values and handle errors.
Tested on:
MacOSX/64 10.9.3 (amazon) w/C++, FORTRAN & parallel
(h5committested on trunk)
Diffstat (limited to 'config')
-rw-r--r-- | config/gnu-flags | 82 |
1 files changed, 79 insertions, 3 deletions
diff --git a/config/gnu-flags b/config/gnu-flags index b965bf0..5f36eaa 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -186,10 +186,86 @@ esac # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in -# Closer to the gcc 4.9 release, we should check for additional flags to +# Closer to the gcc 4.10 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.[89]*) + gcc-4.9*) + # Replace -ansi flag with -std=c99 flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Append warning flags + # Don't use the '-Wtraditional' flag, we're way past having K&R C code + # H5_CFLAGS="$H5_CFLAGS -Wtraditional" + # Don't use the '-Wtraditional-conversion' flag, there's too many warnings + # from GCC's assert macro + # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" + + # 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 -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-overflow=5 -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" + + # Append more extra warning flags that only gcc 4.7+ know about + H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" + + # Append more extra warning flags that only gcc 4.8+ know about + H5_CFLAGS="$H5_CFLAGS -Wsuggest-attribute=format" + + # Append more extra warning flags that only gcc 4.9+ know about + H5_CFLAGS="$H5_CFLAGS -Wdate-time -Wopenmp-simd" + + # 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.8*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" @@ -617,7 +693,7 @@ case "$cc_vendor-$cc_version" in #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" ;; - gcc-4.1*) + gcc-4.1.*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" |