Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!ur-tut!sunybcs!boulder!hao!ames!elroy!devvax!lroot From: lroot@devvax.JPL.NASA.GOV (The Superuser) Newsgroups: comp.sources.bugs Subject: perl 1.0 patch #1 Summary: This is an official patch for perl 1.0. Please apply it. Message-ID: <1093@devvax.JPL.NASA.GOV> Date: 22 Jan 88 06:24:35 GMT Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 715 System: perl version 1.0 Patch #: 1 Priority: MEDIUM Subject: Portability bugs and one possible SIGSEGV From: Dan Faigin, Doug Landauer Description: On some systems the Configure script and C compilations get warning messages that may scare some folks unnecessarily. Also, use of the "redo" command if debugging is compiled in overflows a stack on which the trace context is kept. Fix: From rn, say "| patch -d DIR", where DIR is your perl source directory. Outside of rn, say "cd DIR; patch #define PATCHLEVEL 1 Index: Configure Prereq: 1.0 *** Configure.old Thu Jan 21 22:20:21 1988 *** Configure Thu Jan 21 22:20:22 1988 *************** *** 8,14 **** # and edit it to reflect your system. Some packages may include samples # of config.h for certain machines, so you might look for one of those.) # ! # $Header: Configure,v 1.0 87/12/18 15:05:56 root Exp $ # # Yes, you may rip this off to use in other distribution packages. # (Note: this Configure script was generated automatically. Rather than --- 8,14 ---- # and edit it to reflect your system. Some packages may include samples # of config.h for certain machines, so you might look for one of those.) # ! # $Header: Configure,v 1.0.1.1 88/01/21 21:21:47 root Exp $ # # Yes, you may rip this off to use in other distribution packages. # (Note: this Configure script was generated automatically. Rather than *************** *** 67,76 **** --- 67,79 ---- cc='' contains='' cpp='' + cppminus='' d_charsprf='' d_index='' + d_stdstdio='' d_strctcpy='' d_vfork='' + d_voidsig='' libc='' libnm='' mansrc='' *************** *** 90,95 **** --- 93,99 ---- shsharp='' sharpbang='' startsh='' + stdchar='' voidflags='' defvoidused='' CONFIG='' *************** *** 110,116 **** trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3 attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr" attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200" ! attrlist="$attrlist ns32000 ns16000 iAPX286" pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib" defvoidused=7 --- 114,120 ---- trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3 attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr" attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200" ! attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc" pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib" defvoidused=7 *************** *** 200,207 **** Much effort has been expended to ensure that this shell script will run on any Unix system. If despite that it blows up on you, your best bet is ! to edit Configure and run it again. Also, let me (lwall@sdcrdcf.UUCP) know ! how I blew it. If you can't run Configure for some reason, you'll have to generate a config.sh file by hand. This installation script affects things in two ways: 1) it may do direct --- 204,211 ---- Much effort has been expended to ensure that this shell script will run on any Unix system. If despite that it blows up on you, your best bet is ! to edit Configure and run it again. Also, let me (lwall@jpl-devvax.jpl.nasa.gov) ! know how I blew it. If you can't run Configure for some reason, you'll have to generate a config.sh file by hand. This installation script affects things in two ways: 1) it may do direct *************** *** 546,551 **** --- 550,643 ---- fi rm -f try today + : see how we invoke the C preprocessor + echo " " + echo "Now, how can we feed standard input to your C preprocessor..." + cat <<'EOT' >testcpp.c + #define ABC abc + #define XYZ xyz + ABC.XYZ + EOT + echo 'Maybe "/lib/cpp" will work...' + /lib/cpp testcpp.out 2>&1 + if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Yup, it does." + cpp='/lib/cpp' + cppminus=''; + else + echo 'Nope, maybe "/lib/cpp -" will work...' + /lib/cpp - testcpp.out 2>&1 + if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Yup, it does." + cpp='/lib/cpp' + cppminus='-'; + else + echo 'No such luck...maybe "cc -E" will work...' + cc -E testcpp.out 2>&1 + if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then + echo "It works!" + cpp='cc -E' + cppminus=''; + else + echo 'Nixed again...maybe "cc -E -" will work...' + cc -E - testcpp.out 2>&1 + if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Hooray, it works! I was beginning to wonder." + cpp='cc -E' + cppminus='-'; + else + echo 'Nope...maybe "cc -P" will work...' + cc -P testcpp.out 2>&1 + if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Yup, that does." + cpp='cc -P' + cppminus=''; + else + echo 'Nope...maybe "cc -P -" will work...' + cc -P - testcpp.out 2>&1 + if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Yup, that does." + cpp='cc -P' + cppminus='-'; + else + echo 'Hmm...perhaps you already told me...' + case "$cpp" in + '') ;; + *) $cpp $cppminus testcpp.out 2>&1;; + esac + if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Hooray, you did! I was beginning to wonder." + else + echo 'Uh-uh. Time to get fancy...' + echo 'Trying (cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)' + cpp='(cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)' + cppminus=''; + $cpp testcpp.out 2>&1 + if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Eureka!." + else + dflt=blurfl + $echo $n "No dice. I can't find a C preprocessor. Name one: $c" + rp='Name a C preprocessor:' + . myread + cpp="$ans" + $cpp testcpp.out 2>&1 + if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then + echo "OK, that will do." + else + echo "Sorry, I can't get that to work. Go find one." + exit 1 + fi + fi + fi + fi + fi + fi + fi + fi + fi + rm -f testcpp.c testcpp.out + : see if sprintf is declared as int or pointer to char echo " " if $contains 'char.*sprintf' /usr/include/stdio.h >/dev/null 2>&1 ; then *************** *** 579,584 **** --- 671,691 ---- esac fi + : see if stdio is really std + echo " " + if $contains 'char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then + if $contains '_cnt;' /usr/include/stdio.h >/dev/null 2>&1 ; then + echo "Your stdio is pretty std." + d_stdstdio="$define" + else + echo "Your stdio isn't very std." + d_stdstdio="$undef" + fi + else + echo "Your stdio isn't very std." + d_stdstdio="$undef" + fi + : check for structure copying echo " " echo "Checking to see if your C compiler can copy structs..." *************** *** 611,616 **** --- 718,733 ---- d_vfork="$define" fi + : see if signal is declared as pointer to function returning int or void + echo " " + if $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ; then + echo "You have void (*signal())() instead of int." + d_voidsig="$define" + else + echo "You have int (*signal())() instead of void." + d_voidsig="$undef" + fi + : check for void type echo " " $cat </dev/null 2>&1 ; then + echo "Your stdio uses unsigned chars." + stdchar="unsigned char" + else + echo "Your stdio uses signed chars." + stdchar="char" + fi + : preserve RCS keywords in files with variable substitution, grrr Log='$Log' Header='$Header' *************** *** 793,853 **** ;; esac - : see how we invoke the C preprocessor - echo " " - echo "Checking to see how your C preprocessor is invoked..." - cat <<'EOT' >testcpp.c - #define ABC abc - #define XYZ xyz - ABC.XYZ - EOT - echo 'Maybe "cc -E" will work...' - cc -E testcpp.c >testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, it does." - cpp='cc -E' - else - echo 'Nope...maybe "cc -P" will work...' - cc -P testcpp.c >testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, that does." - cpp='cc -P' - else - echo 'Nixed again...maybe "/lib/cpp" will work...' - /lib/cpp testcpp.c >testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Hooray, it works! I was beginning to wonder." - cpp='/lib/cpp' - else - echo 'Hmm...maybe you already told me...' - case "$cpp" in - '') ;; - *) $cpp testcpp.c >testcpp.out 2>&1;; - esac - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Hooray, you did! I was beginning to wonder." - else - dflt=blurfl - $echo $n "Nope. I can't find a C preprocessor. Name one: $c" - rp='Name a C preprocessor:' - . myread - cpp="$ans" - $cpp testcpp.c >testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "OK, that will do." - else - echo "Sorry, I can't get that to work. Go find one." - exit 1 - fi - fi - fi - fi - fi - rm -f testcpp.c testcpp.out - : get C preprocessor symbols handy echo " " ! echo $attrlist | $tr '[ ]' '[\012]' >Cppsym.know $cat <Cppsym $startsh case "\$1" in --- 920,928 ---- ;; esac : get C preprocessor symbols handy echo " " ! echo $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know $cat <Cppsym $startsh case "\$1" in *************** *** 874,886 **** case \$# in 0) exit 1;; esac ! echo \$* | $tr '[ ]' '[\012]' | $sed -e 's/\(.*\)/\\ #ifdef \1\\ exit 0; _ _ _ _\1\\ \1\\ #endif\\ /' >/tmp/Cppsym\$\$ echo exit 1 >>/tmp/Cppsym\$\$ ! $cpp /tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$ case "\$list" in true) awk '\$6 != "" {print substr(\$6,2,100)}' /tmp/Cppsym\$\$ echo exit 1 >>/tmp/Cppsym\$\$ ! $cpp $cppminus /tmp/Cppsym2\$\$ case "\$list" in true) awk '\$6 != "" {print substr(\$6,2,100)}' = 6 registers) */ int i; int bpx; int obpx; --- 321,328 ---- register char *bp; /* we're going to steal some values */ register int cnt; /* from the stdio struct and put EVERYTHING */ ! register STDCHAR *ptr; /* in the innermost loop into registers */ ! register char newline = record_separator;/* (assuming >= 6 registers) */ int i; int bpx; int obpx;