summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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