History

detect [more] non-constant initialisers (cinap)

Charles Forsyth committed 10 years agomaster

Commit de2aa6c1 parent d3cbf781 file · +8 −1Browse files

Unified · Split

cc/dcl.c+8−1
@@ -381,8 +381,15 @@ init1(Sym *s, Type *t, long o, int exflag) · 380 unmodified lines
381 diag(a, "initialization of incompatible pointers: %s\n%T and %T",381 diag(a, "initialization of incompatible pointers: %s\n%T and %T",
382 s->name, t, a->type);382 s->name, t, a->type);
383 }383 }
384 if(a->op == OADDR)384 switch(a->op) {
385 case OADDR:
385 a = a->left;386 a = a->left;
387 break;
388 case ONAME:
389 case OIND:
390 diag(a, "initializer is not a constant: %s", s->name);
391 return Z;
392 }
386 goto gext;393 goto gext;
387 }394 }
388 395