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

            Bug ID: 80919
           Summary: [7 Regression] ICE: Segmentation fault with -Wall when
                    printing address of size 0 array
           Product: gcc
           Version: 7.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bastian.beisc...@rwth-aachen.de
  Target Milestone: ---

Hey,

the following code causes a GCC segmentation fault when compiled with -Wall:

#include <stdio.h>

void conftest(void)
{
  int gid[0];
  printf("%x\n", &gid);
}

Compiler output:

$ gcc -Wall -c -o conftest.o conftest.c
conftest.c: In function ‘conftest’:
conftest.c:6:3: internal compiler error: Segmentation fault
   printf("%x\n", &gid);
   ^~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.

Cheers
Bastian

Reply via email to