This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70730] Inconsistent column number in "error: attempt to take address of bit-field structure member"
- 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: Tue, 19 Apr 2016 23:13:38 +0000
- Subject: [Bug c/70730] Inconsistent column number in "error: attempt to take address of bit-field structure member"
- Auto-submitted: auto-generated
- References: <bug-70730-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70730
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic, easyhack
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-04-19
CC| |manu at gcc dot gnu.org
Depends on| |43486
Ever confirmed|0 |1
--- Comment #1 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
manu@localhost:~/gcc/gcc/c-family$ grep -C 3 "attempt to take address of" *.c
c-common.c- t = TREE_OPERAND (expr, 1);
c-common.c- if (DECL_C_BIT_FIELD (t))
c-common.c- {
c-common.c: error ("attempt to take address of bit-field structure "
c-common.c- "member %qD", t);
c-common.c- return error_mark_node;
c-common.c- }
error() uses "input_location" and that may point to anything. You need to use
error_at(), with the proper location of the second operand. (I'm not sure if
the second operand always have a proper location. If not, this then depends on
PR43486)
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43486
[Bug 43486] Preserve variable-use locations