[cfe-dev] "error: expected ';' after expression" caret diagnostic

Alexei Svitkine alexei.svitkine at gmail.com
Thu Jan 29 11:56:50 PST 2009


When a semicolon is missing, clang correctly diagnoses the error.

However, the diagnostic caret is shown at the beginning of the next
line, rather than at the end of the line missing the semicolon.

For example:

int main(void)
{
	int i = 1;
	return i -1
}

Results in:

abc.c:5:1: error: expected ';' after return statement
}
^

That doesn't seem very helpful - wouldn't it be better to have the
caret point to the end of "return i - 1"?

-Alexei



More information about the cfe-dev mailing list