diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-23 15:30:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-23 15:30:22 (GMT) |
commit | 79184f310f692cb4cc6498dc43692f494a229ea0 (patch) | |
tree | daf130ab38c5f68e5a000c07f002b1104fd7513a /config | |
parent | 0eb01e1a4216226765d67c0a61afc2fbd4c5ce85 (diff) | |
download | hdf5-79184f310f692cb4cc6498dc43692f494a229ea0.zip hdf5-79184f310f692cb4cc6498dc43692f494a229ea0.tar.gz hdf5-79184f310f692cb4cc6498dc43692f494a229ea0.tar.bz2 |
[svn-r8727] Purpose:
Code cleanup & addition
Description:
Add new warnings for gcc 3.4.x
Re-work production mode compile flags to work better.
Platforms tested:
FreeBSD 4.10 (sleipnir)
h5committest
Diffstat (limited to 'config')
-rw-r--r-- | config/gnu-flags | 254 |
1 files changed, 140 insertions, 114 deletions
diff --git a/config/gnu-flags b/config/gnu-flags index c0184c8..bf9d856 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -124,43 +124,44 @@ esac # Common GCC flags for various situations case "$cc_vendor-$cc_version" in - gcc*|egcs*|pgcc*) - # General - CFLAGS="$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" - - # Production - case "$cc_vendor-$cc_version" in - gcc-2.95.[34]) - PROD_CFLAGS="-O3 $NOFP" - ;; - gcc-3.[0-4]*) - # The optimization level is reduced for gcc 3.* due to problems - # with code generation for src/H5Tconv.c with the -O2 & -O3 - # optimization levels for gcc 3.2.2 and gcc 3.3.2 (which shows up as - # failures for various integer types -> long long conversions in the - # test/dtypes test). Perhaps later versions of gcc will fix this - # bug... - QAK - 2003/10/20 - PROD_CFLAGS="-O $NOFP" - ;; - gcc-3*) - # Be optimistic about future versions of gcc.. :-) - QAK - 2003/10/20 - PROD_CFLAGS="-O3 $NOFP" - ;; - *) - PROD_CFLAGS="-O $NOFP -finline-functions" - ;; - esac - PROD_CPPFLAGS= + gcc*|egcs*|pgcc*) + # General + CFLAGS="$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" + + # Production + case "$cc_vendor-$cc_version" in + gcc-2.95.[34]) + PROD_CFLAGS="-O3 $NOFP" + ;; + gcc-3.[0-4]*) + # The optimization level is reduced for gcc 3.* due to problems + # with code generation for src/H5Tconv.c with the -O2 & -O3 + # optimization levels for gcc 3.2.2 and gcc 3.3.2 (which shows up as + # failures for various integer types -> long long conversions in the + # test/dtypes test). Perhaps later versions of gcc will fix this + # bug... - QAK - 2003/10/20 + PROD_CFLAGS="-O $NOFP" + ;; + gcc-3*) + # Be optimistic about future versions of gcc.. :-) - QAK - 2003/10/20 + PROD_CFLAGS="-O3 $NOFP" + ;; + *) + PROD_CFLAGS="-O $NOFP" + ;; + esac - # Debug - DEBUG_CFLAGS="-g -fverbose-asm" - DEBUG_CPPFLAGS= + PROD_CFLAGS="$PROD_CFLAGS -finline-functions" + PROD_CPPFLAGS= - # Profile - PROFILE_CFLAGS=-pg - PROFILE_CPPFLAGS= + # Debug + DEBUG_CFLAGS="-g -fverbose-asm" + DEBUG_CPPFLAGS= - ;; + # Profile + PROFILE_CFLAGS="-g -pg" + PROFILE_CPPFLAGS= + ;; esac # Version specific GCC flags @@ -168,87 +169,112 @@ esac # Please follow the pattern below by adding new versions at the top, copying # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in - gcc-3.3*) - # Replace -ansi flag with -std=c99 flag - CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" - - # Append warning flags from gcc-2.95.* case - CFLAGS="$CFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - - # Append warning flags from gcc-3.2* case - CFLAGS="$CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append more extra warning flags that only gcc3.3+ know about - CFLAGS="$CFLAGS -Wendif-labels" - - # Flags are set - cc_flags_set=yes - ;; - - gcc-3.2*) - # Replace -ansi flag with -std=c99 flag - CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" - - # Append warning flags from gcc-2.95.* case - CFLAGS="$CFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - - # Append more extra warning flags that only gcc3.2+ know about - CFLAGS="$CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Flags are set - cc_flags_set=yes - ;; - - gcc-3*) - # Replace -ansi flag with -std=c99 flag - CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" - - # Append warning flags from gcc-2.95.* case - CFLAGS="$CFLAGS -Wno-long-long" - - # Append some extra warning flags that only gcc3+ know about - CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - - # Flags are set - cc_flags_set=yes - ;; - - gcc-2.95*) - # Append some extra warning flags that only gcc2.95+ know about - CFLAGS="$CFLAGS -Wno-long-long" - - # Flags are set - cc_flags_set=yes - ;; - - gcc-2.96*) - # -Wno-long-long to suppress the long long warnings since we want - # to use it though it is not in the C89 standard. - CFLAGS="$CFLAGS -Wno-long-long" - - # Flags are set - cc_flags_set=yes - ;; + gcc-3.4*) + # Replace -ansi flag with -std=c99 flag + CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" + + # Append warning flags from gcc-3* case + CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + + # Append warning flags from gcc-3.2* case + CFLAGS="$CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" + + # The "format=2" warning generates too many warnings about valid + # usage in the library. + #CFLAGS="$CFLAGS -Wformat=2" + + # The "unreachable code" warning does not appear to be reliable yet... + #CFLAGS="$CFLAGS -Wunreachable-code" + + # Append warning flags from gcc-3.3* case + CFLAGS="$CFLAGS -Wendif-labels" + + # Append more extra warning flags that only gcc3.4+ know about + CFLAGS="$CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + + # Flags are set + cc_flags_set=yes + ;; + + gcc-3.3*) + # Replace -ansi flag with -std=c99 flag + CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" + + # Append warning flags from gcc-3* case + CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + + # Append warning flags from gcc-3.2* case + CFLAGS="$CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" + + # The "format=2" warning generates too many warnings about valid + # usage in the library. + #CFLAGS="$CFLAGS -Wformat=2" + + # The "unreachable code" warning does not appear to be reliable yet... + #CFLAGS="$CFLAGS -Wunreachable-code" + + # Append more extra warning flags that only gcc3.3+ know about + CFLAGS="$CFLAGS -Wendif-labels" + + # Flags are set + cc_flags_set=yes + ;; + + gcc-3.2*) + # Replace -ansi flag with -std=c99 flag + CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" + + # Append warning flags from gcc-3* case + CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + + # Append more extra warning flags that only gcc3.2+ know about + CFLAGS="$CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" + + # The "format=2" warning generates too many warnings about valid + # usage in the library. + #CFLAGS="$CFLAGS -Wformat=2" + + # The "unreachable code" warning does not appear to be reliable yet... + #CFLAGS="$CFLAGS -Wunreachable-code" + + # Flags are set + cc_flags_set=yes + ;; + + gcc-3*) + # Replace -ansi flag with -std=c99 flag + CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" + + # Append some extra warning flags that only gcc3+ know about + CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + + # Flags are set + cc_flags_set=yes + ;; + + gcc-2.9[56]*) + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" + + # Flags are set + cc_flags_set=yes + ;; esac # Clear cc info if no flags set -if test X = "X$cc_flags_set"; then - cc_vendor= - cc_version= +if test "X$cc_flags_set" = "X"; then + cc_vendor= + cc_version= fi |