summaryrefslogtreecommitdiff
path: root/cflags.SH
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-09-18 04:19:25 +0300
committerhv <hv@crypt.org>2002-09-26 09:15:55 +0000
commit93189314521460c01625b05f7cfa81ac855affa9 (patch)
tree0daf409e1e27efb5bda55df447292e5f02193f4a /cflags.SH
parenta29f6d035abe7b06489dad2706479b252a072f02 (diff)
downloadperl-93189314521460c01625b05f7cfa81ac855affa9.tar.gz
enable -ansi -pedantic
Message-ID: <20020917221925.GF85044@lyta.hut.fi> p4raw-id: //depot/perl@17925
Diffstat (limited to 'cflags.SH')
-rwxr-xr-xcflags.SH27
1 files changed, 24 insertions, 3 deletions
diff --git a/cflags.SH b/cflags.SH
index 3ee7c5f0c6..453fff67c7 100755
--- a/cflags.SH
+++ b/cflags.SH
@@ -123,18 +123,39 @@ for file do
*) ;;
esac
-# Add -Wall for the core and core modules iff gcc and not already -Wall
+# Add -Wall for the core modules iff gcc and not already -Wall
warn=''
case "$gccversion" in
'') ;;
*) case "$ccflags" in
*-Wall*) ;;
-# Can't add -ansi here because it will fail e.g. in Solaris.
+ *) warn="$warn -Wall" ;;
+ esac
+ case "$gccansipedantic" in
+ define)
+ case "$osname" in
+ # Add -ansi -pedantic only for known platforms.
+ aix|dec_osf|freebsd|hpux|irix|linux)
+ ansipedantic="-ansi -pedantic" ;;
+ solaris)
+# Can't add -ansi for Solaris.
# Off_t/off_t is a struct in Solaris with largefiles, and with -ansi
# that struct cannot be compared with a flat integer, such as a STRLEN.
# The -ansi will also cause a lot of noise in Solaris because of:
# /usr/include/sys/resource.h:148: warning: `struct rlimit64' declared inside parameter list
- *) warn='-Wall' ;;
+ ansipedantic="-pedantic" ;;
+ esac
+ for i in $ansipedantic
+ do
+ case "$ccflags" in
+ *$i*) ;;
+ *) warn="$warn $i" ;;
+ esac
+ done
+ case "$warn$ccflags" in
+ *-pedantic*) warn="$warn -DPERL_GCC_PEDANTIC" ;;
+ esac
+ ;;
esac
;;
esac