diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-09-08 19:04:55 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-09-08 19:04:55 +0200 |
commit | 662fd71e115b1cbd35233f2d64f7828bb9bd3f59 (patch) | |
tree | 815f2d3d87e9bb2053599656cae01ec311acd967 | |
parent | 62eec43340340fa981340e4b521908b40b84b782 (diff) | |
parent | 71939a82ccc505b0baa990d7fe17e7085d0ab8fc (diff) | |
download | plan9front-662fd71e115b1cbd35233f2d64f7828bb9bd3f59.tar.xz |
merge
-rw-r--r-- | sys/src/cmd/audio/libFLAC/mkfile | 2 | ||||
-rw-r--r-- | sys/src/cmd/cc/dcl.c | 40 |
2 files changed, 21 insertions, 21 deletions
diff --git a/sys/src/cmd/audio/libFLAC/mkfile b/sys/src/cmd/audio/libFLAC/mkfile index 43ac51946..7e84440a0 100644 --- a/sys/src/cmd/audio/libFLAC/mkfile +++ b/sys/src/cmd/audio/libFLAC/mkfile @@ -26,6 +26,6 @@ OFILES=\ window.$O\ 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 diff --git a/sys/src/cmd/cc/dcl.c b/sys/src/cmd/cc/dcl.c index 4e6fd7775..03410bcb9 100644 --- a/sys/src/cmd/cc/dcl.c +++ b/sys/src/cmd/cc/dcl.c @@ -373,35 +373,35 @@ init1(Sym *s, Type *t, long o, int exflag) goto gext; } if(t->etype == TIND) { - while(a->op == OCAST) { + if(a->op == OCAST) 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", 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) a = a->left; - if(a->op == OADDR) { - warn(a, "initialize pointer to an integer: %s", s->name); + + switch(a->op) { + case OADDR: + if(t->etype != TIND) + warn(a, "initialize pointer to an integer: %s", s->name); 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); + return Z; } - diag(a, "initializer is not a constant: %s", s->name); - return Z; gext: gextern(s, a, o, t->width); |