summaryrefslogtreecommitdiffstats
path: root/config/gnu-flags
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2011-04-18 10:24:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2011-04-18 10:24:39 (GMT)
commitd90f14295aac3335d812e92f2a91baa8c32bd765 (patch)
tree724c8c3fb9280b8b41860910411d9b524b6f9af1 /config/gnu-flags
parent0badac6423ddfeb881345838e3879ad413e52ad1 (diff)
downloadhdf5-d90f14295aac3335d812e92f2a91baa8c32bd765.zip
hdf5-d90f14295aac3335d812e92f2a91baa8c32bd765.tar.gz
hdf5-d90f14295aac3335d812e92f2a91baa8c32bd765.tar.bz2
[svn-r20540] Description:
Bring r20538 & r20539 from trunk to 1.8 branch: Update with new warning flags for gcc 4.6.x Bring Coverity changes back to trunk: r20276: Add recursive is vlen string function. Cleanup resource leaks for issues: 200,202,329,688,811,812 r20277: Check types and close by adding error section: issue 687 r20278: Replaced implicit pointer conversion with (ocrt_info.new_obj != NULL). r20280: Addressed coverity issues 927-929 & 583. The real issue is failure to check file name length -- at least at the H5FD interface level. This needs more work, but at least I have dealt with the issue in H5FDfamily.c r20337: H5O_type_t obj_type = H5O_TYPE_UNKNOWN; r20338: Added udata.name = NULL; to prevent potential uninitialized use after done: label. r20339: coverity issues: 686,828,1670-1673,1707-1711 Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode FreeBSD/32 8.2 (loyalty) w/gcc4.6, in debug mode FreeBSD/64 8.2 (freedom) w/gcc4.6, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Diffstat (limited to 'config/gnu-flags')
-rw-r--r--config/gnu-flags70
1 files 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