merge
This commit is contained in:
commit
662fd71e11
|
@ -26,6 +26,6 @@ OFILES=\
|
||||||
window.$O\
|
window.$O\
|
||||||
|
|
||||||
CC=pcc
|
CC=pcc
|
||||||
CFLAGS=-I. -I../libogg -DVERSION="1.3.1" -DPlan9 -DFLAC__NO_ASM -DFLAC__HAS_OGG -DFLAC__ALIGN_MALLOC_DATA -D_C99_SNPRINTF_EXTENSION -D_BSD_EXTENSION -D_POSIX_SOURCE -c
|
CFLAGS=-I. -I../libogg -DVERSION="1.3.1" -DPlan9 -DFLAC__NO_ASM -DFLAC__HAS_OGG -DFLAC__ALIGN_MALLOC_DATA -D_C99_SNPRINTF_EXTENSION -D_BSD_EXTENSION -D_POSIX_SOURCE -DHAVE_STDINT_H -c
|
||||||
|
|
||||||
</sys/src/cmd/mklib
|
</sys/src/cmd/mklib
|
||||||
|
|
|
@ -373,35 +373,35 @@ init1(Sym *s, Type *t, long o, int exflag)
|
||||||
goto gext;
|
goto gext;
|
||||||
}
|
}
|
||||||
if(t->etype == TIND) {
|
if(t->etype == TIND) {
|
||||||
while(a->op == OCAST) {
|
if(a->op == OCAST)
|
||||||
warn(a, "CAST in initialization ignored");
|
warn(a, "CAST in initialization ignored");
|
||||||
a = a->left;
|
if(!sametype(t, a->type))
|
||||||
}
|
|
||||||
if(!sametype(t, a->type)) {
|
|
||||||
diag(a, "initialization of incompatible pointers: %s\n%T and %T",
|
diag(a, "initialization of incompatible pointers: %s\n%T and %T",
|
||||||
s->name, t, a->type);
|
s->name, t, a->type);
|
||||||
}
|
}
|
||||||
switch(a->op) {
|
|
||||||
case OADDR:
|
|
||||||
a = a->left;
|
|
||||||
break;
|
|
||||||
case ONAME:
|
|
||||||
case OIND:
|
|
||||||
diag(a, "initializer is not a constant: %s", s->name);
|
|
||||||
return Z;
|
|
||||||
}
|
|
||||||
goto gext;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(a->op == OCAST)
|
while(a->op == OCAST)
|
||||||
a = a->left;
|
a = a->left;
|
||||||
if(a->op == OADDR) {
|
|
||||||
|
switch(a->op) {
|
||||||
|
case OADDR:
|
||||||
|
if(t->etype != TIND)
|
||||||
warn(a, "initialize pointer to an integer: %s", s->name);
|
warn(a, "initialize pointer to an integer: %s", s->name);
|
||||||
a = a->left;
|
a = a->left;
|
||||||
goto gext;
|
break;
|
||||||
}
|
case OADD:
|
||||||
|
/*
|
||||||
|
* Constants will be folded before this point, which just leaves offsets
|
||||||
|
* from names.
|
||||||
|
*/
|
||||||
|
l = a->left;
|
||||||
|
r = a->right;
|
||||||
|
if(l->op == OADDR && r->op == OCONST || r->op == OADDR && l->op == OCONST)
|
||||||
|
break;
|
||||||
|
default:
|
||||||
diag(a, "initializer is not a constant: %s", s->name);
|
diag(a, "initializer is not a constant: %s", s->name);
|
||||||
return Z;
|
return Z;
|
||||||
|
}
|
||||||
|
|
||||||
gext:
|
gext:
|
||||||
gextern(s, a, o, t->width);
|
gextern(s, a, o, t->width);
|
||||||
|
|
Loading…
Reference in a new issue