This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/31754] Include column number along line in error messages main.cpp:5:38
- From: "dseketel at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jul 2008 16:29:43 -0000
- Subject: [Bug other/31754] Include column number along line in error messages main.cpp:5:38
- References: <bug-31754-13581@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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