This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/66527] New: incorrect line number in diagnostics for multiline initializers


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.)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]