summaryrefslogtreecommitdiff
path: root/cflags.SH
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-06-15 12:12:53 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-06-15 10:01:14 +0000
commit0aec9d3674a357d2c5a029483ff5cdc65c715a57 (patch)
treeb0d41aa89d84c8994e2d4d139a8b8a2c20b94df3 /cflags.SH
parentea0c9945451f56a84f32146fc82b0bf755b08003 (diff)
downloadperl-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-xcflags.SH32
1 files changed, 29 insertions, 3 deletions
diff --git a/cflags.SH b/cflags.SH
index 6c26025379..ab79c983fb 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