This is the mail archive of the gcc-bugs@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]

[Bug c/52655] confusing "error: label at end of compound statement" for default without statement


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52655

Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |manu at gcc dot gnu.org
         Resolution|                            |DUPLICATE
            Summary|right shit in switch: gcc   |confusing "error: label at
                   |compiles with error: label  |end of compound statement"
                   |at end of compound          |for default without
                   |statement                   |statement

--- Comment #3 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-03-21 12:05:07 UTC ---
The location is correct (line 12, where the default is), but GCC doesn't have
caret info, so the user probably got confused.

Clang gives:

/tmp/webcompile/_24877_0.c:12:13: error: label at end of compound statement:
expected statement
    default:
            ^
1 error generated.

which is the same message and the same location but the caret clarifies
everything.

I really don't see how the diagnostics could be improved short of implementing
caret diagnostics, which is already opened in another PR24985.

*** This bug has been marked as a duplicate of bug 24985 ***


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