From: Holger.Rasch@arbi.informatik.uni-oldenburg.de (Holger Rasch)
Subject: Re: DEC AXP (Alpha) c89 bug
Date: Thu, 17 Mar 1994 22:45:35 GMT [thread overview]
Message-ID: <1994Mar17.230228.572@arbi.Informatik.Uni-Oldenburg.DE> (raw)
In-Reply-To: COATES.94Mar17111610@kelvin.physics.uq.oz.au
coates@kelvin.physics.uq.oz.au (Tony Coates) writes:
> [...] I found
>that, when compiled with c89, a switch statement of the form
>
> switch(<function evaluation>) {
> case -1: <blah>; break;
> case 1: <blah>; break;
> default: <blah>
> }
>
>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=<something large> */
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=<xxx>' and use
<xxx> = 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
next prev parent reply other threads:[~1994-03-17 22:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-03-17 16:16 DEC AXP (Alpha) c89 bug Tony Coates
1994-03-17 11:37 ` Charles M Richmond
1994-03-18 16:14 ` Tony Coates
1994-03-17 22:45 ` Holger Rasch [this message]
1994-03-22 16:27 ` Andre Beck
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox