From: Jarkko Hietaniemi Date: Thu, 15 Jun 2006 09:12:53 +0000 (+0300) Subject: cflags.SH: rework the gcc warnings selection X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0aec9d3674a357d2c5a029483ff5cdc65c715a57;p=p5sagit%2Fp5-mst-13.2.git cflags.SH: rework the gcc warnings selection Message-ID: <4490FA65.70006@iki.fi> p4raw-id: //depot/perl@28397 --- diff --git a/cflags.SH b/cflags.SH index 6c26025..ab79c98 100755 --- a/cflags.SH +++ b/cflags.SH @@ -123,16 +123,24 @@ for file do *) ;; esac -# Add -Wall for the core modules iff gcc and not already -Wall warn='' + +# Add -Wall for the core modules iff gcc and not already -Wall case "$gccversion" in '') ;; -Intel*) ;; +Intel*) ;; # The Intel C++ plays gcc on TV but is not really it. *) case "$ccflags" in *-Wall*) ;; *) warn="$warn -Wall" ;; esac - case "$gccansipedantic" in + ;; +esac + +# The gcc -ansi -pedantic require their own dance, too. +case "$gccversion" in +'') ;; +Intel*) ;; +*) case "$gccansipedantic" in define) case "$gccversion" in [12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this. @@ -165,6 +173,24 @@ Intel*) ;; ;; esac +# Further gcc warning options. +case "$gccversion" in +'') ;; +Intel*) ;; +*) for opt in '' extra declaration-after-statement endif-labels + do + case " $ccflags " in + *"-W$opt "*) ;; + *) case "`echo | $cc -W$opt -E - 2>&1`" in + *"unrecognized"*) ;; + *) warn="$warn -W$opt" ;; + esac + ;; + esac + done + ;; +esac + if test -f .patch; then ccflags="-DPERL_PATCHNUM=`cat .patch` $ccflags" fi