This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add new step to run_byacc which:
authorNick Ing-Simmons <nik@tiuk.ti.com>
Thu, 14 Jun 2001 08:25:07 +0000 (08:25 +0000)
committerNick Ing-Simmons <nik@tiuk.ti.com>
Thu, 14 Jun 2001 08:25:07 +0000 (08:25 +0000)
 A. Corrects #line NNN "perly.c" lines so warnings etc. are trackable
 B. Adds extra () to the two if (var = ...) constructs gcc -Wall winges about.

p4raw-id: //depot/perlio@10586

MANIFEST
Makefile.SH
perly.c
perlyline.pl [new file with mode: 0644]

index 0ca5004..e5f39df 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -10,6 +10,7 @@ Changes5.005          Differences between 5.004 and 5.005
 Changes5.6             Differences between 5.005 and 5.6
 Configure              Portability tool
 Copying                        The GNU General Public License
+Cross/README           Cross-compilation.
 EXTERN.h               Included before foreign .h files
 INSTALL                        Detailed installation instructions
 INTERN.h               Included before domestic .h files
@@ -1193,6 +1194,7 @@ lib/validate.pl           Perl library supporting wholesale file mode validation
 lib/vars.pm            Declare pseudo-imported global variables
 lib/warnings.pm                For "use warnings"
 lib/warnings/register.pm       For "use warnings::register"
+locale.c               locale-specific utility functions
 makeaperl.SH           perl script that produces a new perl binary
 makedef.pl             Create symbol export lists for linking
 makedepend.SH          Precursor to makedepend
@@ -1215,6 +1217,7 @@ mpeix/relink              MPE/iX port
 mv-if-diff             Script to mv a file if it changed
 myconfig.SH            Prints summary of the current configuration
 nostdio.h              Cause compile error on stdio calls
+numeric.c              Miscellaneous numeric conversion routines
 objXSUB.h              Scoping macros for Perl Object in extensions
 op.c                   Opcode syntax tree code
 op.h                   Opcode syntax tree header
@@ -1288,6 +1291,7 @@ perly.c                   A byacc'ed perly.y
 perly.fixer            A program to remove yacc stack limitations
 perly.h                        The header file for perly.c
 perly.y                        Yacc grammar for perl
+perlyline.pl           Perl code to fix #line directives and gcc warnings in perly.c
 perly_c.diff           Fixup perly.c to allow recursion
 plan9/aperl            Shell to make Perl error messages Acme-friendly
 plan9/arpa/inet.h      Plan9 port: replacement C header file
index 23b0e46..618f120 100644 (file)
@@ -26,7 +26,7 @@ ldlibpth=''
 DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
 case "$useshrplib" in
 true)
-       # Prefix all runs of 'miniperl' and 'perl' with 
+       # Prefix all runs of 'miniperl' and 'perl' with
        # $ldlibpth so that ./perl finds *this* shared libperl.
        case "$LD_LIBRARY_PATH" in
        '')
@@ -263,13 +263,13 @@ h = $(h1) $(h2) $(h3) $(h4) $(h5)
 c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c
 c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c
 c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c xsutils.c
-c4 = globals.c perlio.c perlapi.c
+c4 = globals.c perlio.c perlapi.c numeric.c locale.c
 
 c = $(c1) $(c2) $(c3) $(c4) miniperlmain.c perlmain.c
 
 obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT)
 obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
-obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT)
+obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) locale$(OBJ_EXT)
 
 obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
 
@@ -295,7 +295,7 @@ all: $(FIRSTMAKEFILE) miniperl extra.pods $(private) $(public) $(dynamic_ext) $(
 compile: all
        echo "testing compilation" > testcompile;
        cd utils;  $(MAKE) compile;
-       cd x2p; $(MAKE) compile; 
+       cd x2p; $(MAKE) compile;
        cd pod; $(MAKE) compile;
 
 translators:   miniperl lib/Config.pm FORCE
@@ -559,7 +559,7 @@ perl.gprof: /usr/bin/gprof perl.gprof.config
 
 # Microperl.  This is just a convenience thing if one happens to
 # build also the full Perl and therefore the real big Makefile:
-# usually one should manually explicitly issue the below command. 
+# usually one should manually explicitly issue the below command.
 
 microperl:
        $(MAKE) -f Makefile.micro
@@ -594,7 +594,7 @@ preplibrary: miniperl lib/Config.pm lib/lib.pm lib/re.pm
                autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
 
 # Take care to avoid modifying lib/Config.pm without reason
-# (If trying to create a new port and having problems with the configpm script, 
+# (If trying to create a new port and having problems with the configpm script,
 # try 'make minitest' and/or commenting out the tests at the end of configpm.)
 lib/Config.pm: config.sh miniperl configpm lib/re.pm
        $(LDLIBPTH) ./miniperl configpm configpm.tmp
@@ -686,6 +686,7 @@ run_byacc:  FORCE check_byacc
            -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
        sed -e '/^extern YYSTYPE yy/D' y.tab.h >yh.tmp && mv yh.tmp y.tab.h
        cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h
+       perl -i perlyline.pl perly.c
        chmod 664 vms/perly_c.vms vms/perly_h.vms
        perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
 
@@ -855,11 +856,11 @@ _cleaner2:
        rm -f testcompile compilelog
        -rmdir lib/B lib/Data lib/Digest lib/Encode lib/IO/Socket lib/IO lib/Filter/Util lib/List lib/MIME lib/PerlIO lib/Scalar lib/Sys lib/Thread lib/XS
 
-_realcleaner: 
+_realcleaner:
        @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean
        @$(LDLIBPTH) $(MAKE) _cleaner2
 
-_verycleaner: 
+_verycleaner:
        @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
        @$(LDLIBPTH) $(MAKE) _cleaner2
        -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
diff --git a/perly.c b/perly.c
index 61a6fd3..a98279a 100644 (file)
--- a/perly.c
+++ b/perly.c
@@ -1405,7 +1405,7 @@ static char *yyrule[] = {
 #endif
 #define yyparse() Perl_yyparse(pTHX)
 
-#line 1481 "perly.c"
+#line 1409 "perly.c"
 #define YYABORT goto yyabort
 #define YYACCEPT goto yyaccept
 #define YYERROR goto yyerrlab
@@ -1437,7 +1437,7 @@ yyparse()
     ysave->oldyylval   = yylval;
   
 #if YYDEBUG
-    if (yys = getenv("YYDEBUG"))
+    if ((yys = getenv("YYDEBUG")))
     {
         yyn = *yys;
         if (yyn >= '0' && yyn <= '9')
@@ -1464,7 +1464,7 @@ yyparse()
     *yyssp = yystate = 0;
 
 yyloop:
-    if (yyn = yydefred[yystate]) goto yyreduce;
+    if ((yyn = yydefred[yystate])) goto yyreduce;
     if (yychar < 0)
     {
         if ((yychar = yylex()) < 0) yychar = 0;
@@ -2455,7 +2455,7 @@ case 197:
 #line 786 "perly.y"
 { yyval.opval = yyvsp[0].opval; }
 break;
-#line 2477 "perly.c"
+#line 2459 "perly.c"
     }
     yyssp -= yym;
     yystate = *yyssp;
diff --git a/perlyline.pl b/perlyline.pl
new file mode 100644 (file)
index 0000000..f360fb4
--- /dev/null
@@ -0,0 +1,11 @@
+$line = 1;
+while (<>)
+ {
+  $line++;
+  # 1st correct #line directives for perly.c itself
+  s/^(#line\s+)\d+(\s*"perly\.c"\s*)$/$1$line$2/;
+  # now add () round things gcc dislikes
+  s/if \(yyn = yydefred\[yystate\]\)/if ((yyn = yydefred[yystate]))/;
+  s/if \(yys = getenv\("YYDEBUG"\)\)/if ((yys = getenv("YYDEBUG")))/;
+  print;
+ }