H. Peter Anvin wrote: > goto labels are scoped in one sense: they are only reachable from inside > the block they are defined in, so I would disagree with this statement. > Erm, no I think you're wrong there (or we're talking at cross purposes). They're visible to the whole function they're defined in, regardless of what block scope happens to be current at the time. You need to use the gcc "__label__" extension to make a locally-scoped label. Otherwise this wouldn't work: if (a_failed) goto cleanup; [...] if (b_failed) { cleanup: cleanup(); } J - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- From: "H. Peter Anvin" <[email protected]>
- Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- References:
- [RFC] Documentation/CodingStyle: Add rules for goto labels
- From: WANG Cong <[email protected]>
- Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- From: Al Viro <[email protected]>
- Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- From: Randy Dunlap <[email protected]>
- Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- From: Jeff Garzik <[email protected]>
- Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- From: WANG Cong <[email protected]>
- Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- From: Jeremy Fitzhardinge <[email protected]>
- Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- From: "H. Peter Anvin" <[email protected]>
- [RFC] Documentation/CodingStyle: Add rules for goto labels
- Prev by Date: Re: [patch 1/9] Conditional Calls - Architecture Independent Code
- Next by Date: Re: iperf: performance regression (was b44 driver problem?)
- Previous by thread: Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- Next by thread: Re: [RFC] Documentation/CodingStyle: Add rules for goto labels
- Index(es):