Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!fuchs From: fuchs@it.uka.de (Harald Fuchs) Newsgroups: comp.lang.perl Subject: Re: perl bugs in pl41 Keywords: bugs perl41 Message-ID: Date: 6 Dec 90 01:11:56 GMT References: <39929@genrad.UUCP> Sender: news@ira.uka.de (USENET News System) Organization: University of Karlsruhe, FRG Lines: 40 rep@genrad.com (Pete Peterson) writes: > The following bugs all exist in perl 3.41 on all platforms unless otherwise >noted. >There is a bug on the pmax (decstation) which appears to relate to integers >with the MSB set. The following works fine on suns and vaxes but fails in >different ways with perl 3/18 and perl 3/41 on the pmaxen: >printf (" %x, %x, %x, %x\n", 0xffffffff, 0xf0000000, 0x81234567, ~0xffff); >printf (" %x, %x, %x\n", 0xfffffff<<4, 15 << 28, ~1); >$a = 0xffff0000 & 7; $b = 15 << 28 & 7; print " a is $a; b is $b\n"; >Should print (and does except on pmax): > ffffffff, f0000000, 81234567, ffff0000 > fffffff0, f0000000, fffffffe > a is 0; b is 0 >-------------------- >In perl41 on pmax, you get: > 7fffffff, 7fffffff, 7fffffff, 7fffffff > fffffff0, f0000000, 7fffffff > a is 7; b is 0 >-------------------- >In perl18 on pmax, you get: > ffffffff, f0000000, 81234567, 7fffffff > fffffff0, f0000000, 7fffffff > a is 0; b is 0 >This problem can be worked around by editing config.sh, at the end of >running Configure, to make "d_castneg='undef'". Alternatively, you could use a reasonable C compiler, e.g. gcc-osf-1.9.2.13.tar.Z from foobar.colorado.edu. I compiled perl with this gcc (even with -O!) and the script above returned the correct results. -- Harald Fuchs ... *gulp* Brought to you by Super Global Mega Corp .com