This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Prefer -std=c89 over -ansi.
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 25 Nov 2014 00:13:05 +0000 (19:13 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 25 Nov 2014 00:13:43 +0000 (19:13 -0500)
cflags.SH

index bdb4bad..f3e44ad 100755 (executable)
--- a/cflags.SH
+++ b/cflags.SH
@@ -182,9 +182,11 @@ Intel*) ;; # # Is that you, Intel C++?
 #   longer then the ANSI minimum of 509 bytes.
 #
 # NOTE 3: the relative order of these options matters:
-# -Wextra before -W, and -pedantic* before -Werror=d-a-s.
+# -Wextra before -W
+# -std=c89 before -ansi
+# -pedantic* before -Werror=d-a-s
 #
-*)  for opt in -ansi -std=c89 $pedantic \
+*)  for opt in -std=c89 -ansi $pedantic \
                -Werror=declaration-after-statement \
                -Wextra -W \
                -Wc++-compat -Wwrite-strings
@@ -213,6 +215,17 @@ Intel*) ;; # # Is that you, Intel C++?
                  echo "cflags.SH: Adding $opt."
                  stdflags="$stdflags $opt"
                  ;;
+               -ansi)
+                 # -std=c89 is the modern form of -ansi, so add
+                 # -ansi only if -std=c89 is not there already.
+                 case " $stdflags " in
+                 *-std=c89*) ;;
+                 *)
+                   echo "cflags.SH: Adding $opt."
+                   stdflags="$stdflags $opt"
+                   ;;
+                 esac
+                 ;;
                *) case "$opt" in
                   -W)
                     # -Wextra is the modern form of -W, so add