diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-09-18 04:19:25 +0300 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-09-26 09:15:55 +0000 |
commit | 93189314521460c01625b05f7cfa81ac855affa9 (patch) | |
tree | 0daf409e1e27efb5bda55df447292e5f02193f4a /cflags.SH | |
parent | a29f6d035abe7b06489dad2706479b252a072f02 (diff) | |
download | perl-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-x | cflags.SH | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -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 |