From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fc89c,d8fe0a66b911f78d X-Google-Attributes: gidfc89c,public X-Google-Thread: fee84,d8fe0a66b911f78d X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,d8fe0a66b911f78d X-Google-Attributes: gidf678f,public From: baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes) Subject: Re: cc bugs? Date: 1996/07/23 Message-ID: #1/1 X-Deja-AN: 169646765 sender: news@ukpsshp1.serigate.philips.nl (account for localnews) references: <31F3C67A.237C@zk3.dec.com> <31F4A4BE.6201@iisc.com> followup-to: comp.unix.programmer,comp.unix.osf.osf1,comp.unix.osf.misc organization: Philips Semiconductors, Southampton, UK newsgroups: comp.unix.programmer,comp.unix.osf.osf1,comp.unix.osf.misc Charles M Richmond (cmr@iisc.com) wrote: : #include : main() : { : unsigned long E1 = ~0 ; : printf("%lu %x %lu %x %d %d\n",E1 >> 1,E1>>1,E1/2, E1/2,0x20,'\x20'); : return 0; : } : koibito.iisc.com> make junk : cc junk.c -o junk : koibito.iisc.com> junk : 9223372036854775807 ffffffff 9223372036854775807 ffffffff 32 3158648 : koibito.iisc.com> cc -std -o junk junk.c : koibito.iisc.com> junk : 9223372036854775807 ffffffff 9223372036854775807 ffffffff 32 32 : koibito.iisc.com> cc -std1 -o junk junk.c : koibito.iisc.com> junk : 9223372036854775807 ffffffff 9223372036854775807 ffffffff 32 32 : koibito.iisc.com> uname -a : OSF1 koibito.iisc.com V3.2 41 alpha : So it is broken on 3.2d... Looks like the '\x20' is broken for the first compile. I think the the rest of the stuff looks OK. The problem is you have used %x rather than %lx for the hex prints so are printing 32 rather than 64 bits and I belive your long is 64 bits. [A quick calculation with dc gives 2^32-1 as 18446744073709551615 ~(long)0 2^31-1 as 9223372036854775807 (~(long)0) >> 1 ] -- Stephen Baynes baynes@ukpsshp1.serigate.philips.nl Philips Semiconductors Ltd Southampton My views are my own. United Kingdom Are you using ISO8859-1? Do you see � as copyright, � as division and � as 1/2?