Scopes in which __label__ can appear

Gabriel Dos Reis gdr@integrable-solutions.net
Sun Jul 20 00:48:00 GMT 2003


"Zack Weinberg" <zack@codesourcery.com> writes:

| Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
| 
| > | > In parallel to your argument, there is no particular reason to reject
| > | > the above. 
| > | 
| > | So the __label__ in this example has no effect at all?
| >
| > Basically,  I'm saying yes.  It would  be a no-op.
| 
| I don't like that,

Again, personal preference?

| I think it'd be confusing and surprising to users.

What certainly is confusing is not to give label a function-scope.


| I'd much rather either reject the code or narrow the scope of the
| label (and therefore reject the code because the label isn't in scope
| for the goto).

Narrowing the scope goes against the general invariant that  labels
have function scope, and that would create an unnecessary confusion.

-- Gaby



More information about the Gcc mailing list