summaryrefslogtreecommitdiff
path: root/cflags.SH
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-11-24 19:13:05 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2014-11-24 19:13:43 -0500
commitbf78513fd9ba938ecdb1dcbf1ec2d3912924749b (patch)
tree66239cedc0980c10f3890a2311e30033bd560abe /cflags.SH
parentfd9d4a0b0b9647f6fa78f27c2d0ded19ddd76fa0 (diff)
downloadperl-bf78513fd9ba938ecdb1dcbf1ec2d3912924749b.tar.gz
Prefer -std=c89 over -ansi.
Diffstat (limited to 'cflags.SH')
-rwxr-xr-xcflags.SH17
1 files changed, 15 insertions, 2 deletions
diff --git a/cflags.SH b/cflags.SH
index bdb4bad971..f3e44ad8e9 100755
--- 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