This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52655] confusing "error: label at end of compound statement" for default without statement
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Mar 2012 12:05:07 +0000
- Subject: [Bug c/52655] confusing "error: label at end of compound statement" for default without statement
- Auto-submitted: auto-generated
- References: <bug-52655-4@http.gcc.gnu.org/bugzilla/>
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 ***