Change 28576 by [EMAIL PROTECTED] on 2006/07/15 11:41:59

        Subject: [PATCH] Re: [PATCH] cflags.SH: add -std=c89
        From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
        Date: Sat, 15 Jul 2006 12:19:45 +0300
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/cflags.SH#29 edit

Differences ...

==== //depot/perl/cflags.SH#29 (xtext) ====
Index: perl/cflags.SH
--- perl/cflags.SH#28~28483~    2006-07-05 05:48:57.000000000 -0700
+++ perl/cflags.SH      2006-07-15 04:41:59.000000000 -0700
@@ -33,7 +33,7 @@
 # The gcc -ansi -pedantic require their own dance, too.
 case "$gccversion" in
 '') ;;
-Intel*) ;;
+Intel*) ;; # Is that you, Intel C++?
 *)  case "$gccansipedantic" in
     define)
        case "$gccversion" in
@@ -71,7 +71,7 @@
 case "$gccversion" in
 '') ;;
 [12]*) ;;
-Intel*) ;;
+Intel*) ;; # Haven't we been through this already?
 *)  for opt in '' extra declaration-after-statement endif-labels
     do
        case " $ccflags " in
@@ -88,6 +88,21 @@
     ;;
 esac
 
+
+stdflags=''
+
+# Be strict C89 for gcc (but not for g++).
+case "$gccversion" in
+'') ;;
+Intel*) ;; # Nice try, Intel C++.
+12]*) ;; # Go easy on the older versions of gcc.
+*) case "$cc" in
+   *g++*) ;;
+   *) stdflags="$stdflags -std=c89" ;;
+   esac
+   ;;
+esac
+
 echo "Extracting cflags (with variable substitutions)"
 : This section of the file will have variable substitutions done on it.
 : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
@@ -97,8 +112,10 @@
 $spitshell >cflags <<!GROK!THIS!
 $startsh
 
-# Used for gcc.
+# Extra warnings, used e.g. for gcc.
 warn="$warn"
+# Extra standardness.
+stdflags="$stdflags"
 
 !GROK!THIS!
 
@@ -204,8 +221,8 @@
 fi
 
     : Can we perhaps use $ansi2knr here
-    echo "$cc -c -DPERL_CORE $ccflags $optimize $warn"
-    eval "$also "'"$cc -DPERL_CORE -c $ccflags $optimize $warn"'
+    echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn"
+    eval "$also "'"$cc -DPERL_CORE -c $ccflags $stdflags $optimize $warn"'
 
     . $TOP/config.sh
 
End of Patch.

Reply via email to