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

            Bug ID: 90476
           Summary: prepossessor should error if #line 0
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jg at jguk dot org
  Target Milestone: ---

gcc should reject #line 0

As I understand

#line <next line>
So it could actually only ever be 1 or above. As files start at line 1, not 0.


Although line 0 is invalid, gcc accepts and sets this.


$ gcc -o line5 line5.c
line5.c:0:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ at end of
input

$ cat line5.c
#line 0
mytypo

$

Reply via email to