changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: merge

changeset 7377: f6b32f6f4b93
parent 7376: c6aadaba5c87
parent 7374: b8660f06b4bb
child 7378: b22ea0ca9175
author: cinap_lenrek@felloff.net
date: Sun, 08 Sep 2019 19:04:55 +0200
files:
description: merge
     1.1--- a/sys/src/cmd/audio/libFLAC/mkfile
     1.2+++ b/sys/src/cmd/audio/libFLAC/mkfile
     1.3@@ -26,6 +26,6 @@ OFILES=\
     1.4 	window.$O\
     1.5 
     1.6 CC=pcc
     1.7-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
     1.8+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
     1.9 
    1.10 </sys/src/cmd/mklib
     2.1--- a/sys/src/cmd/cc/dcl.c
     2.2+++ b/sys/src/cmd/cc/dcl.c
     2.3@@ -373,35 +373,35 @@ init1(Sym *s, Type *t, long o, int exfla
     2.4 			goto gext;
     2.5 		}
     2.6 		if(t->etype == TIND) {
     2.7-			while(a->op == OCAST) {
     2.8+			if(a->op == OCAST)
     2.9 				warn(a, "CAST in initialization ignored");
    2.10-				a = a->left;
    2.11-			}
    2.12-			if(!sametype(t, a->type)) {
    2.13+			if(!sametype(t, a->type))
    2.14 				diag(a, "initialization of incompatible pointers: %s\n%T and %T",
    2.15 					s->name, t, a->type);
    2.16-			}
    2.17-			switch(a->op) {
    2.18-			case OADDR:
    2.19-				a = a->left;
    2.20-				break;
    2.21-			case ONAME:
    2.22-			case OIND:
    2.23-				diag(a, "initializer is not a constant: %s", s->name);
    2.24-				return Z;
    2.25-			}
    2.26-			goto gext;
    2.27 		}
    2.28 
    2.29 		while(a->op == OCAST)
    2.30 			a = a->left;
    2.31-		if(a->op == OADDR) {
    2.32-			warn(a, "initialize pointer to an integer: %s", s->name);
    2.33+
    2.34+		switch(a->op) {
    2.35+		case OADDR:
    2.36+			if(t->etype != TIND)
    2.37+				warn(a, "initialize pointer to an integer: %s", s->name);
    2.38 			a = a->left;
    2.39-			goto gext;
    2.40+			break;
    2.41+		case OADD:
    2.42+			/*
    2.43+			 * Constants will be folded before this point, which just leaves offsets
    2.44+			 * from names.
    2.45+			 */
    2.46+			l = a->left;
    2.47+			r = a->right;
    2.48+			if(l->op == OADDR && r->op == OCONST || r->op == OADDR && l->op == OCONST)
    2.49+				break;
    2.50+		default:
    2.51+			diag(a, "initializer is not a constant: %s", s->name);
    2.52+			return Z;
    2.53 		}
    2.54-		diag(a, "initializer is not a constant: %s", s->name);
    2.55-		return Z;
    2.56 
    2.57 	gext:
    2.58 		gextern(s, a, o, t->width);