This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/66527] New: incorrect line number in diagnostics for multiline initializers
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 12 Jun 2015 22:21:45 +0000
- Subject: [Bug preprocessor/66527] New: incorrect line number in diagnostics for multiline initializers
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66527
Bug ID: 66527
Summary: incorrect line number in diagnostics for multiline
initializers
Product: gcc
Version: 5.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
In a diagnostic message pointing to an initializer that spans multiple lines,
instead of pointing to the offending construct gcc points to the line withe the
terminating semicolon or closing brace (when the initializer is an aggregate).
For example:
$ cat t.c && /build/gcc-66516/gcc/xgcc -B /build/gcc-66516/gcc -S -o/dev/null
t.c
/* 1 */ void f (register int i) {
/* 2 */ int* a =
/* 3 */ &i
/* 4 */ ;
/* 5 */ }
t.c: In function âfâ:
t.c:4:9: error: address of register variable âiâ requested
/* 4 */ ;
^
(I haven't seen this mentioned on the
https://gcc.gnu.org/wiki/Better_Diagnostics Wiki; sorry if this is another
known issue and I missed it.)