lkml.org 
[lkml]   [2003]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: GCC 3.4 Heads-up
From
Date
linux@horizon.com 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@suse.de
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.041 / U:1.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site