lwall@jpl-devvax.jpl.nasa.gov (Larry Wall) (04/14/91)
System: perl version 4.0 Patch #: 1 Priority: HIGH Subject: Configure now handles defaults much better Subject: Configure now knows if config.sh was built on this machine Subject: Configure now checks file existence more efficiently Subject: Configure now handles stupid SCO csh Configure has been heavily revised. Many of the tests that used to simply force a decision now check that decision against the previous value of the variable, and offer to let you change it. The default now is to keep the old value, so that you don't lose information from your previous run. Because of this, it's now more important to know whether, in fact, config.sh was produced on this machine and on this version of the operating system. config.sh now contains a lastuname variable which contains the output of uname -a. If this matches the current output of uname -a, Configure defaults to including the old config.sh. Otherwise not. If there is no valid config.sh, then Configure looks defaults for the current architecture in the hints/ subdirectory instead. The guesswork I've done in this section of code is phenomenal, so you'll have to instruct me where I've misparsed the output of uname (a problem in portability all of its own). Subject: Configure now differentiates getgroups() type from getgid() type Subject: Configure now figures out malloc ptr type Subject: Configure now does better on sprintf() Configure was assuming that the array of values returned from getgroups was the same type as the gids returned by other system calls. Unfortunately, reality set in. Likewise for malloc() and sprintf(), which there is only one portable way to find out the return value of: try it one way or the other, and see if it blows up. Subject: C flags are now settable on a per-file basis Subject: reduced maximum branch distance in eval.c Certain compilers and/or optimizers get bozoed out by large compilation units, or by large structures within those units. Previously, you either had to change the compiler flags for all the files, or do hairy editing in Makefile.SH and remake the Makefile, necessitating a make depend. Now there is a script called cflags.SH whose duty it is to return the proper CFLAGS for any given C file. You can change the flags in just one spot now and they will be immediately reflected in the next make (or even in the current make, if one is running). Eventually I expect that any of the hints files could modify cflags.SH, but I haven't done that yet. The particular problem of long jump offsets in eval.c has been at least partially alleviated by locating some of the labels in the middle of the function instead of at the end. This still doesn't help the poor Vax when you compile with -g, since it puts a jump to the end of the function to allocate the stack frame and then jumps back to the beginning of the function to execute it. For now Vaxen will have to stick with -O or hand assemble eval.c and teval.c with a -J switch. Subject: fixed "Bad free" error Subject: fixed debugger coredump on subroutines Subject: regexec only allocated space for 9 subexpresssions These are problems that were reported on the net and had unofficial patches. Now they have official patches. Be sure to patch a copy of your files without the unofficial patches, or the patch program will get confused. Subject: you may now use "die" and "caller" in a signal handler Someone pointed out that using die to raise an exception out of a signal handler trashed the expression value stack if the exception was caught by eval. While fixing that, I also fixed the longstanding problem that signal handlers didn't have a normal call frame, which prevented the caller function from working. Subject: fixed undefined environ problem Subject: hopefully straightened out some of the Xenix mess Subject: random cleanup in cpp namespace Just keeping up with the current progress in non-standardization. Subject: fixed failed fork to return undef as documented The open function returns undef on failed implicit forks. The Book assumed that the same was true of an explicit fork. I've made the function behave like the Book says. It's a pity there's no way to have an undefined value that returns -1 in a numeric context but false in a boolean context... Subject: generalized the yaccpar fixer some Thanks to Andy Dougherty, perly.fixer now knows how to fix SVR3 2.2's yaccpar code to do dynamic parse stack allocation. He also made it easy for other people to insert their code there. Hooray! Subject: find2perl sometimes needs to stat on the 2nd leg of a -o Subject: find2perl didn't correctly handle switches with an argument of 0 In attempting to delay the lstat to the last moment, in case a filename could be rejected on the basis of its name, find2perl neglected to take into account the fact that control might pass to the 2nd half of a -o without executing all of the 1st half, in particular without executing the lstat. find2perl was wisely removing leading zeroes from numbers that would mistakenly be interpreted as octal numbers by Perl. Unfortunately, this caused it to delete the number 0 entirely. Subject: fixed dumpvar not to dump internal debugging info Subject: substr($ENV{"PATH"},0,0) = "/foo:" didn't modify environment Subject: $foo .= <BAR> could cause core dump for certain lengths of $foo Subject: perl -de "print" wouldn't stop at the first statement Random glitchy little things. Subject: I'm at NetLabs now I'm now working for NetLabs, Inc., and I hadn't changed my address everywhere. Fix: From rn, say "| patch -p -N -d DIR", where DIR is your perl source directory. Outside of rn, say "cd DIR; patch -p -N <thisarticle". If you don't have the patch program, apply the following by hand, or get patch (version 2.0, latest patchlevel). After patching: *** DO NOTHING. APPLY PATCHES 2-3 FIRST *** If patch indicates that patchlevel is the wrong version, you may need to apply one or more previous patches, or the patch may already have been applied. See the patchlevel.h file to find out what has or has not been applied. In any event, don't continue with the patch. If you are missing previous patches (hah!) they can be obtained from me: Larry Wall lwall@netlabs.com If you send a mail message of the following form it will greatly speed processing: Subject: Command @SH mailpatch PATH perl 4.0 LIST ^ note the c where PATH is a return path FROM ME TO YOU either in Internet notation, or in bang notation from some well-known host, and LIST is the number of one or more patches you need, separated by spaces, commas, and/or hyphens. Saying 35- says everything from 35 to the end. Index: patchlevel.h Prereq: 0 1c1 < #define PATCHLEVEL 0 --- > #define PATCHLEVEL 1 Index: hints/3b2.sh *** hints/3b2.sh.old Fri Apr 12 09:30:13 1991 --- hints/3b2.sh Fri Apr 12 09:30:13 1991 *************** *** 0 **** --- 1 ---- + optimize='-g' Index: MANIFEST *** MANIFEST.old Fri Apr 12 09:29:24 1991 --- MANIFEST Fri Apr 12 09:29:25 1991 *************** *** 12,17 **** --- 12,18 ---- arg.h Public declarations for the above array.c Numerically subscripted arrays array.h Public declarations for the above + cflags.SH A script that emits C compilation flags per file client A client to test sockets cmd.c Command interpreter cmd.h Public declarations for the above *************** *** 86,91 **** --- 87,122 ---- handy.h Handy definitions hash.c Associative arrays hash.h Public declarations for the above + hints/3b2.sh + hints/aix_rs.sh + hints/aix_rt.sh + hints/apollo_C6_7.sh + hints/aux.sh + hints/dnix.sh + hints/dynix.sh + hints/fps.sh + hints/genix.sh + hints/hp9000_300.sh + hints/hp9000_400.sh + hints/hpux.sh + hints/i386.sh + hints/mips.sh + hints/ncr_tower.sh + hints/next.sh + hints/osf_1.sh + hints/sco_2_3_0.sh + hints/sco_2_3_1.sh + hints/sco_2_3_2.sh + hints/sco_2_3_3.sh + hints/sco_3.sh + hints/sgi.sh + hints/sunos_3_4.sh + hints/sunos_3_5.sh + hints/sunos_4_0_1.sh + hints/sunos_4_0_2.sh + hints/ultrix_3.sh + hints/ultrix_4.sh + hints/uts.sh installperl Perl script to do "make install" dirty work ioctl.pl Sample ioctl.pl lib/abbrev.pl An abbreviation table builder Index: Makefile.SH Prereq: 4.0 *** Makefile.SH.old Fri Apr 12 09:29:28 1991 --- Makefile.SH Fri Apr 12 09:29:29 1991 *************** *** 25,33 **** echo "Extracting Makefile (with variable substitutions)" cat >Makefile <<!GROK!THIS! ! # $Header: Makefile.SH,v 4.0 91/03/20 00:58:54 lwall Locked $ # # $Log: Makefile.SH,v $ # Revision 4.0 91/03/20 00:58:54 lwall # 4.0 baseline. # --- 25,36 ---- echo "Extracting Makefile (with variable substitutions)" cat >Makefile <<!GROK!THIS! ! # $RCSfile: Makefile.SH,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:30:39 $ # # $Log: Makefile.SH,v $ + # Revision 4.0.1.1 91/04/11 17:30:39 lwall + # patch1: C flags are now settable on a per-file basis + # # Revision 4.0 91/03/20 00:58:54 lwall # 4.0 baseline. # *************** *** 40,46 **** privlib = $installprivlib mansrc = $mansrc manext = $manext - CFLAGS = $ccflags $optimize LDFLAGS = $ldflags CLDFLAGS = $ldflags SMALL = $small --- 43,48 ---- *************** *** 56,61 **** --- 58,66 ---- !GROK!THIS! cat >>Makefile <<'!NO!SUBS!' + + CFLAGS = `sh cflags.SH $@` + private = scripts = h2ph *************** *** 99,105 **** SHELL = /bin/sh .c.o: ! $(CC) -c $(CFLAGS) $(LARGE) $*.c all: $(public) $(private) $(util) uperl.o $(scripts) cd x2p; $(MAKE) all --- 104,110 ---- SHELL = /bin/sh .c.o: ! $(CC) -c $(CFLAGS) $*.c all: $(public) $(private) $(util) uperl.o $(scripts) cd x2p; $(MAKE) all *************** *** 107,112 **** --- 112,119 ---- # This is the standard version that contains no "taint" checks and is # used for all scripts that aren't set-id or running under something set-id. + # The $& notation is tells Sequent machines that it can do a parallel make, + # and is harmless otherwise. perl: $& perly.o $(obj) usersub.o $(CC) $(LARGE) $(CLDFLAGS) $(obj) perly.o usersub.o $(libs) -o perl *************** *** 140,260 **** tperly.o: perly.c perly.h $(h) /bin/rm -f tperly.c $(SLN) perly.c tperly.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c /bin/rm -f tperly.c tperl.o: perl.c perly.h patchlevel.h perl.h $(h) /bin/rm -f tperl.c $(SLN) perl.c tperl.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c /bin/rm -f tperl.c sperl.o: perl.c perly.h patchlevel.h $(h) /bin/rm -f sperl.c $(SLN) perl.c sperl.c ! $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperl.c /bin/rm -f sperl.c tarray.o: array.c $(h) /bin/rm -f tarray.c $(SLN) array.c tarray.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tarray.c /bin/rm -f tarray.c tcmd.o: cmd.c $(h) /bin/rm -f tcmd.c $(SLN) cmd.c tcmd.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcmd.c /bin/rm -f tcmd.c tcons.o: cons.c $(h) perly.h /bin/rm -f tcons.c $(SLN) cons.c tcons.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcons.c /bin/rm -f tcons.c tconsarg.o: consarg.c $(h) /bin/rm -f tconsarg.c $(SLN) consarg.c tconsarg.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tconsarg.c /bin/rm -f tconsarg.c tdoarg.o: doarg.c $(h) /bin/rm -f tdoarg.c $(SLN) doarg.c tdoarg.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoarg.c /bin/rm -f tdoarg.c tdoio.o: doio.c $(h) /bin/rm -f tdoio.c $(SLN) doio.c tdoio.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoio.c /bin/rm -f tdoio.c tdolist.o: dolist.c $(h) /bin/rm -f tdolist.c $(SLN) dolist.c tdolist.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdolist.c /bin/rm -f tdolist.c tdump.o: dump.c $(h) /bin/rm -f tdump.c $(SLN) dump.c tdump.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdump.c /bin/rm -f tdump.c teval.o: eval.c $(h) /bin/rm -f teval.c $(SLN) eval.c teval.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) teval.c /bin/rm -f teval.c tform.o: form.c $(h) /bin/rm -f tform.c $(SLN) form.c tform.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tform.c /bin/rm -f tform.c thash.o: hash.c $(h) /bin/rm -f thash.c $(SLN) hash.c thash.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) thash.c /bin/rm -f thash.c tregcomp.o: regcomp.c $(h) /bin/rm -f tregcomp.c $(SLN) regcomp.c tregcomp.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregcomp.c /bin/rm -f tregcomp.c tregexec.o: regexec.c $(h) /bin/rm -f tregexec.c $(SLN) regexec.c tregexec.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregexec.c /bin/rm -f tregexec.c tstab.o: stab.c $(h) /bin/rm -f tstab.c $(SLN) stab.c tstab.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstab.c /bin/rm -f tstab.c tstr.o: str.c $(h) perly.h /bin/rm -f tstr.c $(SLN) str.c tstr.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c /bin/rm -f tstr.c ttoke.o: toke.c $(h) perly.h /bin/rm -f ttoke.c $(SLN) toke.c ttoke.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) ttoke.c /bin/rm -f ttoke.c tutil.o: util.c $(h) /bin/rm -f tutil.c $(SLN) util.c tutil.c ! $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tutil.c /bin/rm -f tutil.c perly.h: perly.c --- 147,267 ---- tperly.o: perly.c perly.h $(h) /bin/rm -f tperly.c $(SLN) perly.c tperly.c ! $(CC) -c -DTAINT $(CFLAGS) tperly.c /bin/rm -f tperly.c tperl.o: perl.c perly.h patchlevel.h perl.h $(h) /bin/rm -f tperl.c $(SLN) perl.c tperl.c ! $(CC) -c -DTAINT $(CFLAGS) tperl.c /bin/rm -f tperl.c sperl.o: perl.c perly.h patchlevel.h $(h) /bin/rm -f sperl.c $(SLN) perl.c sperl.c ! $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) sperl.c /bin/rm -f sperl.c tarray.o: array.c $(h) /bin/rm -f tarray.c $(SLN) array.c tarray.c ! $(CC) -c -DTAINT $(CFLAGS) tarray.c /bin/rm -f tarray.c tcmd.o: cmd.c $(h) /bin/rm -f tcmd.c $(SLN) cmd.c tcmd.c ! $(CC) -c -DTAINT $(CFLAGS) tcmd.c /bin/rm -f tcmd.c tcons.o: cons.c $(h) perly.h /bin/rm -f tcons.c $(SLN) cons.c tcons.c ! $(CC) -c -DTAINT $(CFLAGS) tcons.c /bin/rm -f tcons.c tconsarg.o: consarg.c $(h) /bin/rm -f tconsarg.c $(SLN) consarg.c tconsarg.c ! $(CC) -c -DTAINT $(CFLAGS) tconsarg.c /bin/rm -f tconsarg.c tdoarg.o: doarg.c $(h) /bin/rm -f tdoarg.c $(SLN) doarg.c tdoarg.c ! $(CC) -c -DTAINT $(CFLAGS) tdoarg.c /bin/rm -f tdoarg.c tdoio.o: doio.c $(h) /bin/rm -f tdoio.c $(SLN) doio.c tdoio.c ! $(CC) -c -DTAINT $(CFLAGS) tdoio.c /bin/rm -f tdoio.c tdolist.o: dolist.c $(h) /bin/rm -f tdolist.c $(SLN) dolist.c tdolist.c ! $(CC) -c -DTAINT $(CFLAGS) tdolist.c /bin/rm -f tdolist.c tdump.o: dump.c $(h) /bin/rm -f tdump.c $(SLN) dump.c tdump.c ! $(CC) -c -DTAINT $(CFLAGS) tdump.c /bin/rm -f tdump.c teval.o: eval.c $(h) /bin/rm -f teval.c $(SLN) eval.c teval.c ! $(CC) -c -DTAINT $(CFLAGS) teval.c /bin/rm -f teval.c tform.o: form.c $(h) /bin/rm -f tform.c $(SLN) form.c tform.c ! $(CC) -c -DTAINT $(CFLAGS) tform.c /bin/rm -f tform.c thash.o: hash.c $(h) /bin/rm -f thash.c $(SLN) hash.c thash.c ! $(CC) -c -DTAINT $(CFLAGS) thash.c /bin/rm -f thash.c tregcomp.o: regcomp.c $(h) /bin/rm -f tregcomp.c $(SLN) regcomp.c tregcomp.c ! $(CC) -c -DTAINT $(CFLAGS) tregcomp.c /bin/rm -f tregcomp.c tregexec.o: regexec.c $(h) /bin/rm -f tregexec.c $(SLN) regexec.c tregexec.c ! $(CC) -c -DTAINT $(CFLAGS) tregexec.c /bin/rm -f tregexec.c tstab.o: stab.c $(h) /bin/rm -f tstab.c $(SLN) stab.c tstab.c ! $(CC) -c -DTAINT $(CFLAGS) tstab.c /bin/rm -f tstab.c tstr.o: str.c $(h) perly.h /bin/rm -f tstr.c $(SLN) str.c tstr.c ! $(CC) -c -DTAINT $(CFLAGS) tstr.c /bin/rm -f tstr.c ttoke.o: toke.c $(h) perly.h /bin/rm -f ttoke.c $(SLN) toke.c ttoke.c ! $(CC) -c -DTAINT $(CFLAGS) ttoke.c /bin/rm -f ttoke.c tutil.o: util.c $(h) /bin/rm -f tutil.c $(SLN) util.c tutil.c ! $(CC) -c -DTAINT $(CFLAGS) tutil.c /bin/rm -f tutil.c perly.h: perly.c *************** *** 270,276 **** echo 'extern YYSTYPE yylval;' >>perly.h perly.o: perly.c perly.h $(h) ! $(CC) -c $(CFLAGS) $(LARGE) perly.c install: all ./perl installperl --- 277,283 ---- echo 'extern YYSTYPE yylval;' >>perly.h perly.o: perly.c perly.h $(h) ! $(CC) -c $(CFLAGS) perly.c install: all ./perl installperl Index: README *** README.old Fri Apr 12 09:29:31 1991 --- README Fri Apr 12 09:29:32 1991 *************** *** 69,76 **** Most of them should have been taken care of by running the Configure script. If you have any additional changes to make to the C definitions, they ! can be done in the Makefile, or in config.h. Bear in mind that they will ! get undone next time you run Configure. 3) make depend --- 69,79 ---- Most of them should have been taken care of by running the Configure script. If you have any additional changes to make to the C definitions, they ! can be done in cflags.SH. For instance, to turn off the optimizer ! on eval.c, find the line in the switch structure for eval.c and ! put the command $optimize='-g' before the ;;. You will probably ! want to change the entry for teval.c too. To change the C flags ! for all the files, edit config.sh and change either $ccflags or $optimize. 3) make depend *************** *** 91,100 **** Some compilers will not compile or optimize the larger files without some extra switches to use larger jump offsets or allocate larger ! internal tables. It's okay to insert rules for specific files into Makefile.SH, since a default rule only takes effect in the absence of a specific rule. The 3b2 needs to turn off -O. Compilers with limited switch tables may have to define -DSMALLSWITCHES Domain/OS 10.3 (at least) native C 6.7 may need -opt 2 for eval.c --- 94,106 ---- Some compilers will not compile or optimize the larger files without some extra switches to use larger jump offsets or allocate larger ! internal tables. You can customize the switches for each file in ! cflags.SH. It's okay to insert rules for specific files into Makefile.SH, since a default rule only takes effect in the absence of a specific rule. + Most of the following hints are now done automatically by Configure. + The 3b2 needs to turn off -O. Compilers with limited switch tables may have to define -DSMALLSWITCHES Domain/OS 10.3 (at least) native C 6.7 may need -opt 2 for eval.c *************** *** 106,112 **** SGI machines may need -Ddouble="long float" and -O1. Vax-based systems may need to hand assemble teval.s with a -J switch. Ultrix on MIPS machines may need -DLANGUAGE_C. ! Ultrix 4.0 on MIPS machines may need -Olimit 2820 or so. Ultrix 3.[01] on MIPS needs to undefine WAITPID--the system call is busted. MIPS machines may need to undef d_volatile. MIPS machines may need to turn off -O on cmd.c, perl.c and tperl.c. --- 112,118 ---- SGI machines may need -Ddouble="long float" and -O1. Vax-based systems may need to hand assemble teval.s with a -J switch. Ultrix on MIPS machines may need -DLANGUAGE_C. ! Ultrix 4.0 on MIPS machines may need -Olimit 2900 or so. Ultrix 3.[01] on MIPS needs to undefine WAITPID--the system call is busted. MIPS machines may need to undef d_volatile. MIPS machines may need to turn off -O on cmd.c, perl.c and tperl.c. *************** *** 138,144 **** See the README in the t subdirectory. Note that you can't run it in background if this disables opening of /dev/tty. If "make test" bombs out, just cd to the t directory and run TEST by hand to see if ! it makes any difference. 6) make install --- 144,151 ---- See the README in the t subdirectory. Note that you can't run it in background if this disables opening of /dev/tty. If "make test" bombs out, just cd to the t directory and run TEST by hand to see if ! it makes any difference. If individual tests bomb, you can run ! them by hand, e.g., ./perl op/groups.t 6) make install Index: t/README *** t/README.old Fri Apr 12 09:32:23 1991 --- t/README Fri Apr 12 09:32:23 1991 *************** *** 8,11 **** have to worry about removing the extra print statements later since TEST ignores lines beginning with '#'. ! If you come up with new tests, send them to lwall@jpl-devvax.jpl.nasa.gov. --- 8,11 ---- have to worry about removing the extra print statements later since TEST ignores lines beginning with '#'. ! If you come up with new tests, send them to lwall@netlabs.com. Index: hints/aix_rs.sh *** hints/aix_rs.sh.old Fri Apr 12 09:30:15 1991 --- hints/aix_rs.sh Fri Apr 12 09:30:16 1991 *************** *** 0 **** --- 1 ---- + optimize='-g' Index: hints/aix_rt.sh *** hints/aix_rt.sh.old Fri Apr 12 09:30:18 1991 --- hints/aix_rt.sh Fri Apr 12 09:30:18 1991 *************** *** 0 **** --- 1 ---- + ccflags="$ccflags -a -DCRIPPLED_CC" Index: hints/apollo_C6_7.sh *** hints/apollo_C6_7.sh.old Fri Apr 12 09:30:20 1991 --- hints/apollo_C6_7.sh Fri Apr 12 09:30:21 1991 *************** *** 0 **** --- 1 ---- + optimize='-opt 2' Index: hints/aux.sh *** hints/aux.sh.old Fri Apr 12 09:30:22 1991 --- hints/aux.sh Fri Apr 12 09:30:23 1991 *************** *** 0 **** --- 1,2 ---- + optimize='-O' + ccflags="$ccflags -B/usr/lib/bin/' Index: cflags.SH *** cflags.SH.old Fri Apr 12 09:29:34 1991 --- cflags.SH Fri Apr 12 09:29:35 1991 *************** *** 0 **** --- 1,80 ---- + case $CONFIG in + '') + if test ! -f config.sh; then + ln ../config.sh . || \ + ln ../../config.sh . || \ + ln ../../../config.sh . || \ + (echo "Can't find config.sh."; exit 1) + fi 2>/dev/null + . ./config.sh + ;; + esac + case "$0" in + */*) cd `expr X$0 : 'X\(.*\)/'` ;; + esac + + also=': ' + case $# in + 1) also='echo 1>&2 " CFLAGS = "' + esac + + case $# in + 0) set *.c; echo "The current C flags are:" ;; + *) set `echo "$* " | sed 's/\.o /.c /g'` + esac + for file do + + case "$#" in + 1) ;; + *) echo $n " $file $c" ;; + esac + + case "$file" in + array.c) ;; + cmd.c) ;; + cons.c) ;; + consarg.c) ;; + doarg.c) ;; + doio.c) ;; + dolist.c) ;; + dump.c) ;; + eval.c) ;; + form.c) ;; + hash.c) ;; + malloc.c) ;; + perl.c) ;; + perly.c) ;; + regcomp.c) ;; + regexec.c) ;; + stab.c) ;; + str.c) ;; + toke.c) ;; + usersub.c) ;; + util.c) ;; + tarray.c) ;; + tcmd.c) ;; + tcons.c) ;; + tconsarg.c) ;; + tdoarg.c) ;; + tdoio.c) ;; + tdolist.c) ;; + tdump.c) ;; + teval.c) ;; + tform.c) ;; + thash.c) ;; + tmalloc.c) ;; + tperl.c) ;; + tperly.c) ;; + tregcomp.c) ;; + tregexec.c) ;; + tstab.c) ;; + tstr.c) ;; + ttoke.c) ;; + tusersub.c) ;; + tutil.c) ;; + *) ;; + esac + + echo "$ccflags $optimize $large $split" + eval "$also $ccflags $optimize $large $split" + done Index: cmd.c Prereq: 4.0 *** cmd.c.old Fri Apr 12 09:29:38 1991 --- cmd.c Fri Apr 12 09:29:39 1991 *************** *** 1,4 **** ! /* $Header: cmd.c,v 4.0 91/03/20 01:04:18 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $RCSfile: cmd.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:36:16 $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,14 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: cmd.c,v $ + * Revision 4.0.1.1 91/04/11 17:36:16 lwall + * patch1: you may now use "die" and "caller" in a signal handler + * * Revision 4.0 91/03/20 01:04:18 lwall * 4.0 baseline. * *************** *** 908,914 **** } #ifdef DEBUGGING ! # ifndef VARARGS /*VARARGS1*/ deb(pat,a1,a2,a3,a4,a5,a6,a7,a8) char *pat; --- 911,917 ---- } #ifdef DEBUGGING ! # ifndef I_VARARGS /*VARARGS1*/ deb(pat,a1,a2,a3,a4,a5,a6,a7,a8) char *pat; *************** *** 1086,1091 **** --- 1089,1111 ---- } void + saveaptr(aptr) + ARRAY **aptr; + { + register STR *str; + + str = Str_new(17,0); + str->str_state = SS_SAPTR; + str->str_u.str_array = *aptr; /* remember value */ + if (str->str_ptr) { + Safefree(str->str_ptr); + str->str_len = 0; + } + str->str_ptr = (char*)aptr; /* remember pointer */ + (void)apush(savestack,str); + } + + void savelist(sarg,maxsarg) register STR **sarg; int maxsarg; *************** *** 1153,1158 **** --- 1173,1183 ---- break; case SS_SHPTR: /* HASH* reference */ *((HASH**)value->str_ptr) = value->str_u.str_hash; + value->str_ptr = Nullch; + str_free(value); + break; + case SS_SAPTR: /* ARRAY* reference */ + *((ARRAY**)value->str_ptr) = value->str_u.str_array; value->str_ptr = Nullch; str_free(value); break; Index: config_h.SH *** config_h.SH.old Fri Apr 12 09:29:43 1991 --- config_h.SH Fri Apr 12 09:29:44 1991 *************** *** 591,596 **** --- 591,602 ---- */ #define GIDTYPE $gidtype /**/ + /* GROUPSTYPE + * This symbol has a value like gid_t, int, ushort, or whatever type is + * used in the return value of getgroups(). + */ + #define GROUPSTYPE $groupstype /**/ + /* I_FCNTL * This manifest constant tells the C program to include <fcntl.h>. */ *************** *** 739,744 **** --- 745,755 ---- #$i_sys_ndir I_SYS_NDIR /**/ #$i_my_dir I_MY_DIR /**/ #$d_dirnamlen DIRNAMLEN /**/ + + /* MALLOCPTRTYPE + * This symbol defines the kind of ptr returned by malloc and realloc. + */ + #define MALLOCPTRTYPE $mallocptrtype /**/ /* RANDBITS Index: consarg.c Prereq: 4.0 *** consarg.c.old Fri Apr 12 09:29:48 1991 --- consarg.c Fri Apr 12 09:29:49 1991 *************** *** 1,4 **** ! /* $Header: consarg.c,v 4.0 91/03/20 01:06:15 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $RCSfile: consarg.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:38:34 $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,14 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: consarg.c,v $ + * Revision 4.0.1.1 91/04/11 17:38:34 lwall + * patch1: fixed "Bad free" error + * * Revision 4.0 91/03/20 01:06:15 lwall * 4.0 baseline. * *************** *** 555,564 **** if (str) { arg->arg_type = O_ITEM; /* note arg1 type is already SINGLE */ str_free(s1); - str_free(s2); arg[1].arg_ptr.arg_str = str; ! arg[2].arg_ptr.arg_str = Nullstr; ! arg[2].arg_type = A_NULL; } } } --- 558,569 ---- if (str) { arg->arg_type = O_ITEM; /* note arg1 type is already SINGLE */ str_free(s1); arg[1].arg_ptr.arg_str = str; ! if (s2) { ! str_free(s2); ! arg[2].arg_ptr.arg_str = Nullstr; ! arg[2].arg_type = A_NULL; ! } } } } Index: hints/dnix.sh *** hints/dnix.sh.old Fri Apr 12 09:30:25 1991 --- hints/dnix.sh Fri Apr 12 09:30:26 1991 *************** *** 0 **** --- 1 ---- + optimize='-g' Index: doarg.c Prereq: 4.0 *** doarg.c.old Fri Apr 12 09:29:53 1991 --- doarg.c Fri Apr 12 09:29:54 1991 *************** *** 1,4 **** ! /* $Header: doarg.c,v 4.0 91/03/20 01:06:42 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $RCSfile: doarg.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:40:14 $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,15 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: doarg.c,v $ + * Revision 4.0.1.1 91/04/11 17:40:14 lwall + * patch1: fixed undefined environ problem + * patch1: fixed debugger coredump on subroutines + * * Revision 4.0 91/03/20 01:06:42 lwall * 4.0 baseline. * *************** *** 20,29 **** extern unsigned char fold[]; - #ifndef __STDC__ - extern char **environ; - #endif /* ! __STDC__ */ - #ifdef BUGGY_MSC #pragma function(memcmp) #endif /* BUGGY_MSC */ --- 24,29 ---- *************** *** 831,838 **** *t = '\0'; xs = str_get(*sarg); xlen = (*sarg)->str_cur; ! if (*xs == 'S' && xs[1] == 't' && xs[2] == 'B' ! && xlen == sizeof(STBP) && strlen(xs) < xlen) { STR *tmpstr = Str_new(24,0); stab_fullname(tmpstr, ((STAB*)(*sarg))); /* a stab value! */ --- 831,838 ---- *t = '\0'; xs = str_get(*sarg); xlen = (*sarg)->str_cur; ! if (*xs == 'S' && xs[1] == 't' && xs[2] == 'B' && xs[3] == '\0' ! && xlen == sizeof(STBP)) { STR *tmpstr = Str_new(24,0); stab_fullname(tmpstr, ((STAB*)(*sarg))); /* a stab value! */ *************** *** 934,939 **** --- 934,945 ---- } if (!stab) fatal("Undefined subroutine called"); + if (!(sub = stab_sub(stab))) { + STR *tmpstr = arg[0].arg_ptr.arg_str; + + stab_fullname(tmpstr, stab); + fatal("Undefined subroutine \"%s\" called",tmpstr->str_ptr); + } if (arg->arg_type == O_DBSUBR && !sub->usersub) { str = stab_val(DBsub); saveitem(str); *************** *** 941,954 **** sub = stab_sub(DBsub); if (!sub) fatal("No DBsub routine"); - } - else { - if (!(sub = stab_sub(stab))) { - STR *tmpstr = arg[0].arg_ptr.arg_str; - - stab_fullname(tmpstr, stab); - fatal("Undefined subroutine \"%s\" called",tmpstr->str_ptr); - } } str = Str_new(15, sizeof(CSV)); str->str_state = SS_SCSV; --- 947,952 ---- Index: doio.c Prereq: 4.0 *** doio.c.old Fri Apr 12 09:29:58 1991 --- doio.c Fri Apr 12 09:30:00 1991 *************** *** 1,4 **** ! /* $Header: doio.c,v 4.0 91/03/20 01:07:06 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $RCSfile: doio.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:41:06 $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,14 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: doio.c,v $ + * Revision 4.0.1.1 91/04/11 17:41:06 lwall + * patch1: hopefully straightened out some of the Xenix mess + * * Revision 4.0 91/03/20 01:07:06 lwall * 4.0 baseline. * *************** *** 19,35 **** #include <netdb.h> #endif - #ifdef M_UNIX - #if defined(HAS_SELECT) && !defined(I_SYS_TIME) - #include <sys/select.h> - #endif - #endif - - #ifdef M_XENIX #ifdef HAS_SELECT #include <sys/select.h> #endif #endif #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) #include <sys/ipc.h> --- 22,34 ---- #include <netdb.h> #endif #ifdef HAS_SELECT + #ifdef I_SYS_SELECT + #ifndef I_SYS_TIME #include <sys/select.h> #endif #endif + #endif #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) #include <sys/ipc.h> *************** *** 2430,2436 **** #define NGROUPS 32 #endif { ! GIDTYPE gary[NGROUPS]; int anum; anum = getgroups(NGROUPS,gary); --- 2429,2435 ---- #define NGROUPS 32 #endif { ! GROUPSTYPE gary[NGROUPS]; int anum; anum = getgroups(NGROUPS,gary); Index: lib/dumpvar.pl *** lib/dumpvar.pl.old Fri Apr 12 09:31:28 1991 --- lib/dumpvar.pl Fri Apr 12 09:31:28 1991 *************** *** 23,29 **** } print ")\n"; } ! if ($key ne "_$package" && defined %entry) { print "\%$key = (\n"; foreach $key (sort keys(%entry)) { print " $key\t'",&unctrl($entry{$key}),"'\n"; --- 23,29 ---- } print ")\n"; } ! if ($key ne "_$package" && $key ne "_DB" && defined %entry) { print "\%$key = (\n"; foreach $key (sort keys(%entry)) { print " $key\t'",&unctrl($entry{$key}),"'\n"; Index: hints/dynix.sh *** hints/dynix.sh.old Fri Apr 12 09:30:27 1991 --- hints/dynix.sh Fri Apr 12 09:30:29 1991 *************** *** 0 **** --- 1 ---- + d_castneg=undef Index: eval.c Prereq: 4.0 *** eval.c.old Fri Apr 12 09:30:06 1991 --- eval.c Fri Apr 12 09:30:08 1991 *************** *** 1,4 **** ! /* $Header: eval.c,v 4.0 91/03/20 01:16:48 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $RCSfile: eval.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:43:48 $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,15 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: eval.c,v $ + * Revision 4.0.1.1 91/04/11 17:43:48 lwall + * patch1: fixed failed fork to return undef as documented + * patch1: reduced maximum branch distance in eval.c + * * Revision 4.0 91/03/20 01:16:48 lwall * 4.0 baseline. * *************** *** 1857,1862 **** --- 1861,1868 ---- case O_FORK: #ifdef HAS_FORK anum = fork(); + if (anum < 0) + goto say_undef; if (!anum) { if (tmpstab = stabent("$",allstabs)) str_numset(STAB_STR(tmpstab),(double)getpid()); *************** *** 1978,1983 **** --- 1984,2045 ---- else value = (double)scanoct(tmps, 99, &argtype); goto donumset; + + /* These common exits are hidden here in the middle of the switches for the + /* benefit of those machines with limited branch addressing. Sigh. */ + + array_return: + #ifdef DEBUGGING + if (debug) { + dlevel--; + if (debug & 8) { + anum = sp - arglast[0]; + switch (anum) { + case 0: + deb("%s RETURNS ()\n",opname[optype]); + break; + case 1: + deb("%s RETURNS (\"%s\")\n",opname[optype],str_get(st[1])); + break; + default: + tmps = str_get(st[1]); + deb("%s RETURNS %d ARGS (\"%s\",%s\"%s\")\n",opname[optype], + anum,tmps,anum==2?"":"...,",str_get(st[anum])); + break; + } + } + } + #endif + return sp; + + say_yes: + str = &str_yes; + goto normal_return; + + say_no: + str = &str_no; + goto normal_return; + + say_undef: + str = &str_undef; + goto normal_return; + + say_zero: + value = 0.0; + /* FALL THROUGH */ + + donumset: + str_numset(str,value); + STABSET(str); + st[1] = str; + #ifdef DEBUGGING + if (debug) { + dlevel--; + if (debug & 8) + deb("%s RETURNS \"%f\"\n",opname[optype],value); + } + #endif + return arglast[0] + 1; #ifdef SMALLSWITCHES } else *************** *** 2834,2892 **** dlevel--; if (debug & 8) deb("%s RETURNS \"%s\"\n",opname[optype],str_get(str)); - } - #endif - return arglast[0] + 1; - - array_return: - #ifdef DEBUGGING - if (debug) { - dlevel--; - if (debug & 8) { - anum = sp - arglast[0]; - switch (anum) { - case 0: - deb("%s RETURNS ()\n",opname[optype]); - break; - case 1: - deb("%s RETURNS (\"%s\")\n",opname[optype],str_get(st[1])); - break; - default: - tmps = str_get(st[1]); - deb("%s RETURNS %d ARGS (\"%s\",%s\"%s\")\n",opname[optype], - anum,tmps,anum==2?"":"...,",str_get(st[anum])); - break; - } - } - } - #endif - return sp; - - say_yes: - str = &str_yes; - goto normal_return; - - say_no: - str = &str_no; - goto normal_return; - - say_undef: - str = &str_undef; - goto normal_return; - - say_zero: - value = 0.0; - /* FALL THROUGH */ - - donumset: - str_numset(str,value); - STABSET(str); - st[1] = str; - #ifdef DEBUGGING - if (debug) { - dlevel--; - if (debug & 8) - deb("%s RETURNS \"%f\"\n",opname[optype],value); } #endif return arglast[0] + 1; --- 2896,2901 ---- Index: x2p/find2perl.SH *** x2p/find2perl.SH.old Fri Apr 12 09:32:36 1991 --- x2p/find2perl.SH Fri Apr 12 09:32:36 1991 *************** *** 202,208 **** } if (@ARGV) { if ($ARGV[0] eq '-o') { ! local($indent) = $indent - 4; $out .= "\n" . &tab . "||\n"; shift; } --- 202,209 ---- } if (@ARGV) { if ($ARGV[0] eq '-o') { ! $statdone = 0 if $indent == 1 && $delayedstat; ! $saw_or++; $out .= "\n" . &tab . "||\n"; shift; } *************** *** 317,322 **** --- 318,324 ---- next if $_ eq '.'; next if $_ eq '..'; $name = "$dir/$_"; + $nlink = 0; &wanted; } } *************** *** 627,637 **** local($tabstring); $tabstring = "\t" x ($indent / 2) . ' ' x ($indent % 2 * 4); ! if ($_ !~ /^(name|print)/) { ! if (!$statdone) { ! $tabstring .= <<'ENDOFSTAT' . $tabstring; (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && ENDOFSTAT $statdone = 1; } } --- 629,649 ---- local($tabstring); $tabstring = "\t" x ($indent / 2) . ' ' x ($indent % 2 * 4); ! if (!$statdone) { ! if ($_ =~ /^(name|print)/) { ! $delayedstat++; ! } ! else { ! if ($saw_or) { ! $tabstring .= <<'ENDOFSTAT' . $tabstring; ! ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) && ! ENDOFSTAT ! } ! else { ! $tabstring .= <<'ENDOFSTAT' . $tabstring; (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && ENDOFSTAT + } $statdone = 1; } } *************** *** 650,656 **** sub n { local($n) = @_; ! $n =~ s/^-0*/< / || $n =~ s/^\+0*/> / || $n =~ s/^0*/== /; $n; } --- 662,669 ---- sub n { local($n) = @_; ! $n =~ s/^-/< / || $n =~ s/^\+/> / || $n =~ s/^/== /; ! $n =~ s/ 0*(\d)/ $1/; $n; } Index: hints/fps.sh *** hints/fps.sh.old Fri Apr 12 09:30:30 1991 --- hints/fps.sh Fri Apr 12 09:30:31 1991 *************** *** 0 **** --- 1 ---- + ccflags="$ccflags -J -DBADSWITCH" Index: hints/genix.sh *** hints/genix.sh.old Fri Apr 12 09:30:33 1991 --- hints/genix.sh Fri Apr 12 09:30:33 1991 *************** *** 0 **** --- 1 ---- + i_varargs=undef Index: x2p/handy.h Prereq: 4.0 *** x2p/handy.h.old Fri Apr 12 09:32:39 1991 --- x2p/handy.h Fri Apr 12 09:32:40 1991 *************** *** 1,4 **** ! /* $Header: handy.h,v 4.0 91/03/20 01:57:45 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $RCSfile: handy.h,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:29:08 $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,14 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: handy.h,v $ + * Revision 4.0.1.1 91/04/12 09:29:08 lwall + * patch1: random cleanup in cpp namespace + * * Revision 4.0 91/03/20 01:57:45 lwall * 4.0 baseline. * *************** *** 16,21 **** --- 19,30 ---- #define Nullfp Null(FILE*) #define bool char + #ifdef TRUE + #undef TRUE + #endif + #ifdef FALSE + #undef FALSE + #endif #define TRUE (1) #define FALSE (0) Index: hints/hp9000_300.sh *** hints/hp9000_300.sh.old Fri Apr 12 09:30:35 1991 --- hints/hp9000_300.sh Fri Apr 12 09:30:36 1991 *************** *** 0 **** --- 1,2 ---- + optimize='+O1' + ccflags="$ccflags -Wc,-Nw500" Index: hints/hp9000_400.sh *** hints/hp9000_400.sh.old Fri Apr 12 09:30:38 1991 --- hints/hp9000_400.sh Fri Apr 12 09:30:38 1991 *************** *** 0 **** --- 1,2 ---- + optimize='+O1' + ccflags="$ccflags -Wc,-Nw500" Index: hints/hpux.sh *** hints/hpux.sh.old Fri Apr 12 09:30:40 1991 --- hints/hpux.sh Fri Apr 12 09:30:41 1991 *************** *** 0 **** --- 1,4 ---- + d_syscall=$undef + echo " " + echo "NOTE: regression test op.read may fail due to an NFS bug in HP/UX." + echo "If so, don't worry about it." Index: hints/i386.sh *** hints/i386.sh.old Fri Apr 12 09:30:43 1991 --- hints/i386.sh Fri Apr 12 09:30:44 1991 *************** *** 0 **** --- 1 ---- + ldflags='-L/usr/ucblib' *** End of Patch 1 ***