Re: GCC 3.4 Heads-up

From: Andreas Schwab
Date: Sat Dec 27 2003 - 11:42:04 EST


linux@xxxxxxxxxxx writes:

> Or consider the case when the structure doesn't have an explicit size
> and you have a big case statement for parsing it:
>
> switch (a->type) {
> case BAR:
> process_bar_chunk(((struct bar *)a)++);
> break;
> case BAZ:
> process_baz_chunk(((struct baz *)a)++);
> break;
> ...
> };
>
> Isn't that code a bit nicer looking? I put the redundant parens

Except that the parens are not redundant.

> in to remind people that I didn't mean to write "(struct bar *)(a++)"
> (which also has its legitimate uses).

Which is why it's parsed this way by default.

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/