http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60744
Bug ID: 60744
Summary: poor location and error recovery
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: manu at gcc dot gnu.org
#define DEBUG(X) X
void foo(void)
{
DEBUG((
0);
}
test.c: In function ‘foo’:
test.c:7:0: error: unterminated argument list invoking macro "DEBUG"
}
^
test.c:5:5: error: ‘DEBUG’ undeclared (first use in this function)
DEBUG((
^
test.c:5:5: note: each undeclared identifier is reported only once for each
function it appears in
test.c:5:5: error: expected ‘;’ at end of input
test.c:5:5: error: expected declaration or statement at end of input
Problems:
1. The first error does not point to the point where the macro was invoked,
which is the key location. Clang gets this right.
2. All the other errors are useless. This should be a fatal error, since it
will gobble the rest of the input and produce meaningless cascades of errors.