diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2006-06-15 12:12:53 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-06-15 10:01:14 +0000 |
commit | 0aec9d3674a357d2c5a029483ff5cdc65c715a57 (patch) | |
tree | b0d41aa89d84c8994e2d4d139a8b8a2c20b94df3 /cflags.SH | |
parent | ea0c9945451f56a84f32146fc82b0bf755b08003 (diff) | |
download | perl-0aec9d3674a357d2c5a029483ff5cdc65c715a57.tar.gz |
cflags.SH: rework the gcc warnings selection
Message-ID: <4490FA65.70006@iki.fi>
p4raw-id: //depot/perl@28397
Diffstat (limited to 'cflags.SH')
-rwxr-xr-x | cflags.SH | 32 |
1 files changed, 29 insertions, 3 deletions
@@ -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 |