Proposed Enhancement to select/case (yes, I know...)

Karl Heuer karl at haddock.ima.isc.com
Wed Sep 5 10:33:22 AEST 1990


In article <1420 at lupine.NCD.COM> rfg at NCD.COM (Ron Guilmette) writes:
>Regarding "case lists", it seems clear that a simple syntax, i.e.:
>	case FOO,BAR:
>won't work because the separator comma could be parsed as the normal comma
>operator, which would mess up everything.

It would mean that, in the unlikely event that the user *wants* a comma
operator in a case label, he has to parenthesize the expression.  No different
from the existing situation with function arguments or initializer lists,
except that it's a minor incompatibility with the existing language.

>Right.  Given that this feature has already been in g++ for some time,
>you may consider it "prior art".

Is there any particular reason this got added to g++ but not gcc?  It would
seem to be equally useful in both.

Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint



More information about the Comp.std.c mailing list