This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Scopes in which __label__ can appear


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]