From c731eb9d37eac096326abc87dcda6c471af46f63 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 23 Nov 2004 22:25:19 -0500 Subject: [svn-r9569] Purpose: Update flags Description: Update gcc compiler flags to support the early gcc 4.0 snapshots available on sleipnir Platforms tested: FreeBSD 4.10 (sleipnir) w/gcc 4.0 snapshot Too minor to require h5committest --- config/gnu-flags | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index cb2e028..354c7ab 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -129,16 +129,15 @@ case "$cc_vendor-$cc_version" in gcc-2.95.[34]) PROD_CFLAGS="-O3" ;; - gcc-3.[0-4]*) - # The optimization level is reduced for gcc 3.* due to problems + gcc-3.[0-4]*|gcc-4.0*) + # The optimization level is reduced for gcc 3.* and 4.* 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 + # optimization levels (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" ;; - gcc-3*) + gcc-4*) # Be optimistic about future versions of gcc.. :-) - QAK - 2003/10/20 PROD_CFLAGS="-O3" ;; @@ -168,6 +167,39 @@ 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-4.0*) + # 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 warning flags from gcc-3.4* case + CFLAGS="$CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + + # Replace old -W flag with new -Wextra flag + CFLAGS="`echo $CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + + # Append more extra warning flags that only gcc4.0+ know about + CFLAGS="$CFLAGS -Wvariadic-macros" + ;; + gcc-3.4*) # Replace -ansi flag with -std=c99 flag CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" @@ -193,6 +225,9 @@ case "$cc_vendor-$cc_version" in # Append more extra warning flags that only gcc3.4+ know about CFLAGS="$CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + + # Replace old -W flag with new -Wextra flag + CFLAGS="`echo $CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" ;; gcc-3.3*) -- cgit v0.12