https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70257

            Bug ID: 70257
           Summary: #line incorrectly handled in error messages
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rowe-gcc at excc dot ex.ac.uk
  Target Milestone: ---

When the following code is compiled with gcc -Wall :

// This line intentionally left blank
#line 1
#include <stdio.h>
int main() {
    int k;

  return 0;
}

it produces the following:

text.c: In function ‘main’:
text.c:3:9: warning: unused variable ‘k’ [-Wunused-variable]
 #include <stdio.h>
         ^

Clearly although the #line directive is being recognised by the traditional
error code, the wrong line is then highlighted.
The version is: gcc (GCC) 5.3.0

Thanks for all your work on GCC.

John

Reply via email to