[Bug other/31754] Include column number along line in error messages main.cpp:5:38
dseketel at redhat dot com
gcc-bugzilla@gcc.gnu.org
Tue Jul 1 16:30:00 GMT 2008
------- Comment #14 from dseketel at redhat dot com 2008-07-01 16:29 -------
Hello,
Just a quick comment on this bug.
I think that in the example you gave, gcc (at the least 4.3.0 version) is
giving a correct column location.
The expression gcc is complaining about is:
"a +- b".
That expression is normally valid, an can be re-written as a + -b (like in 2 +
-3).
In that case, the '-' is called an "unary minus" operator.
In your case, the reason why gcc is complaining is because 'b' is of type
pointer. And you cannot apply the "unary minus" operator to a pointer.
So gcc complains about the _operand_, saying the operand is of the wrong type.
That is why gcc is referering to the operand, instead of refering to the '-'.
On the other hand, it is notorious that gcc does not display extremely accurate
column numbers in error message. Hopefully, that situation can get better with
the patches attached above.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754
More information about the Gcc-bugs
mailing list