http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61096

            Bug ID: 61096
           Summary: error_init lacks a location
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org

Since error_init doesn't have a location parameter, all of these invalid
initializers have wrong column info in diagnostics.

/* -std=gnu99 -fshort-enums -fshort-wchar -pedantic */

typedef enum { A } schar;
extern int e;
struct S
{
  int a[3];
};
struct f
{
  int w;
  int x[];
};
struct g
{
  struct f f;
};

char w1[] = L"foo";
__WCHAR_TYPE__ w2[] = "foo";
__WCHAR_TYPE__ w3[] = U "foo";
schar a1[] = "foo";
int a2[] = (int[]) { 1 };

int a3 = e;
int a4 = (e, 1);
int a5 = a1[0];
int a6 = &a3 - &a4;
int a7[] = a7;

struct S s = { {1}, {3} };
struct g g1 = { {0, {1}} };
struct g g2 = { .f[0] = 1 };

__extension__ int a8 = { };
int a9[10] = {[1.2] = 2 };
int a10[10] = {[e] = 2 };
__extension__ int a11[10] = {[1 ... e] = 1 };
int a12 = {[1] = 2 };
int a13[2] = {[-1] = 4 };
int a14[2] = {[64] = 4 };
__extension__ int a15[10] = {[2 ... 1] = 4 };
__extension__ int a16[10] = {[2 ... 100] = 4 };
int a17[] = { .B = 1 };
int a18[] = { e };
char a19[1] = { "x", "x" };

void
bar (void)
{
  struct f f = { 2, "c" };
}

Reply via email to