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

            Bug ID: 71362
           Summary: Wrong position for "error: size of unnamed array is
                    negative"
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ch3root at openwall dot com
  Target Milestone: ---

Source code:

----------------------------------------------------------------------
int main()
{
  123 + sizeof(int[-1]);
}
----------------------------------------------------------------------

Results:

----------------------------------------------------------------------
$ gcc -std=c11 -pedantic test.c && ./a.out
test.c: In function ‘main’:
test.c:3:3: error: size of unnamed array is negative
   123 + sizeof(int[-1]);
   ^~~
----------------------------------------------------------------------

gcc version: gcc (GCC) 7.0.0 20160531 (experimental)

Reply via email to