From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,9619a7b956b3cb13 X-Google-Attributes: gidfee84,public X-Google-Thread: 1164f8,9619a7b956b3cb13 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-03-17 14:45:35 PST Xref: gmd.de comp.unix.osf.osf1:2585 comp.sys.dec:14470 Newsgroups: comp.unix.osf.osf1,comp.sys.dec Path: gmd.de!xlink.net!news.ppp.de!lutzifer!news.rrz.uni-hamburg.de!news.dkrz.de!news.dfn.de!urmel.informatik.rwth-aachen.de!news.rhrz.uni-bonn.de!mpifr-bonn.mpg.de!uniol!Holger.Rasch From: Holger.Rasch@arbi.informatik.uni-oldenburg.de (Holger Rasch) Subject: Re: DEC AXP (Alpha) c89 bug Organization: University of Oldenburg, Germany Date: Thu, 17 Mar 1994 22:45:35 GMT Message-ID: <1994Mar17.230228.572@arbi.Informatik.Uni-Oldenburg.DE> References: Sender: news@arbi.Informatik.Uni-Oldenburg.DE coates@kelvin.physics.uq.oz.au (Tony Coates) writes: > [...] I found >that, when compiled with c89, a switch statement of the form > > switch() { > case -1: ; break; > case 1: ; break; > default: > } > >was reaching the default statement, even though the function >evaluation yielded -1. The same statement selected the -1 case when >compiled with cc. hmm ... I wasn't able to reproduce that one but found another interesting thing: /* c89 -DL1 -DL2 -DBIGNUM= */ main (int ac, char **av) { switch (ac) { #ifdef L1 case -1: break; #endif #ifdef L2 case 1: break; #endif #ifdef BIGNUM case BIGNUM: break; #endif } } /* end */ If you use cc or leave out one of { -DL1 -DL2 -DBIGNUM=... } everything works fine. But please try 'c89 -DL1 -DL2 -DBIGNUM=' and use = 10000 50000 100000 1000000 ... watch the size of the executable and time and VM used bye the stages of c89. Please tell me there is an option to c89 to disable this feature :-) -- HR