Commit 96072557 authored by David du Colombier's avatar David du Colombier

cmd/6g, cmd/gc, cmd/ld: fix Plan 9 amd64 warnings

warning: src/cmd/6g/reg.c:671 format mismatch d VLONG, arg 4
warning: src/cmd/gc/pgen.c:230 set and not used: oldstksize
warning: src/cmd/gc/plive.c:877 format mismatch lx UVLONG, arg 2
warning: src/cmd/gc/walk.c:2878 set and not used: cbv
warning: src/cmd/gc/walk.c:2885 set and not used: hbv
warning: src/cmd/ld/data.c:198 format mismatch s IND FUNC(IND CHAR) INT, arg 2
warning: src/cmd/ld/data.c:230 format mismatch s IND FUNC(IND CHAR) INT, arg 2
warning: src/cmd/ld/dwarf.c:1517 set and not used: pc
warning: src/cmd/ld/elf.c:1507 format mismatch d VLONG, arg 2
warning: src/cmd/ld/ldmacho.c:509 set and not used: dsymtab

R=golang-dev, gobot, rsc
CC=golang-dev
https://golang.org/cl/36740045
parent ef0100c7
...@@ -668,7 +668,7 @@ mkvar(Reg *r, Adr *a) ...@@ -668,7 +668,7 @@ mkvar(Reg *r, Adr *a)
v->node = node; v->node = node;
if(debug['R']) if(debug['R'])
print("bit=%2d et=%2E w=%d+%lld %#N %D flag=%d\n", i, et, o, w, node, a, v->addr); print("bit=%2d et=%2E w=%lld+%lld %#N %D flag=%d\n", i, et, o, w, node, a, v->addr);
ostats.nvar++; ostats.nvar++;
......
...@@ -232,6 +232,7 @@ compile(Node *fn) ...@@ -232,6 +232,7 @@ compile(Node *fn)
if(0) if(0)
print("allocauto: %lld to %lld\n", oldstksize, (vlong)stksize); print("allocauto: %lld to %lld\n", oldstksize, (vlong)stksize);
USED(oldstksize);
setlineno(curfn); setlineno(curfn);
if((int64)stksize+maxarg > (1ULL<<31)) { if((int64)stksize+maxarg > (1ULL<<31)) {
......
...@@ -874,7 +874,7 @@ checkauto(Node *fn, Prog *p, Node *n, char *where) ...@@ -874,7 +874,7 @@ checkauto(Node *fn, Prog *p, Node *n, char *where)
print("D_AUTO '%s' not found: name is '%s' function is '%s' class is %d\n", where, nname, fnname, n->class); print("D_AUTO '%s' not found: name is '%s' function is '%s' class is %d\n", where, nname, fnname, n->class);
print("Here '%P'\nlooking for node %p\n", p, n); print("Here '%P'\nlooking for node %p\n", p, n);
for(ll = fn->dcl; ll != nil; ll = ll->next) for(ll = fn->dcl; ll != nil; ll = ll->next)
print("node=%lx, node->class=%d\n", (uintptr)ll->n, ll->n->class); print("node=%p, node->class=%d\n", (uintptr)ll->n, ll->n->class);
yyerror("checkauto: invariant lost"); yyerror("checkauto: invariant lost");
} }
......
...@@ -2886,17 +2886,13 @@ sliceany(Node* n, NodeList **init) ...@@ -2886,17 +2886,13 @@ sliceany(Node* n, NodeList **init)
if(isconst(cb, CTINT)) { if(isconst(cb, CTINT)) {
cbv = mpgetfix(cb->val.u.xval); cbv = mpgetfix(cb->val.u.xval);
if(cbv < 0 || cbv > bv) { if(cbv < 0 || cbv > bv)
yyerror("slice index out of bounds"); yyerror("slice index out of bounds");
cbv = -1;
}
} }
if(isconst(hb, CTINT)) { if(isconst(hb, CTINT)) {
hbv = mpgetfix(hb->val.u.xval); hbv = mpgetfix(hb->val.u.xval);
if(hbv < 0 || hbv > bv) { if(hbv < 0 || hbv > bv)
yyerror("slice index out of bounds"); yyerror("slice index out of bounds");
hbv = -1;
}
} }
if(isconst(lb, CTINT)) { if(isconst(lb, CTINT)) {
lbv = mpgetfix(lb->val.u.xval); lbv = mpgetfix(lb->val.u.xval);
......
...@@ -195,7 +195,7 @@ relocsym(LSym *s) ...@@ -195,7 +195,7 @@ relocsym(LSym *s)
if(rs->type != SHOSTOBJ) if(rs->type != SHOSTOBJ)
o += symaddr(rs); o += symaddr(rs);
} else { } else {
diag("unhandled pcrel relocation for %s", headtype); diag("unhandled pcrel relocation for %s", headstring);
} }
break; break;
} }
...@@ -227,7 +227,7 @@ relocsym(LSym *s) ...@@ -227,7 +227,7 @@ relocsym(LSym *s)
o += symaddr(rs) - rs->sect->vaddr; o += symaddr(rs) - rs->sect->vaddr;
o -= r->off; // WTF? o -= r->off; // WTF?
} else { } else {
diag("unhandled pcrel relocation for %s", headtype); diag("unhandled pcrel relocation for %s", headstring);
} }
break; break;
} }
......
...@@ -1514,7 +1514,6 @@ writelines(void) ...@@ -1514,7 +1514,6 @@ writelines(void)
unitstart = -1; unitstart = -1;
headerend = -1; headerend = -1;
pc = 0;
epc = 0; epc = 0;
epcs = S; epcs = S;
lineo = cpos(); lineo = cpos();
......
...@@ -1504,5 +1504,5 @@ elfobj: ...@@ -1504,5 +1504,5 @@ elfobj:
a += elfwritebuildinfo(); a += elfwritebuildinfo();
} }
if(a > ELFRESERVE) if(a > ELFRESERVE)
diag("ELFRESERVE too small: %d > %d", a, ELFRESERVE); diag("ELFRESERVE too small: %lld > %d", a, ELFRESERVE);
} }
...@@ -507,6 +507,7 @@ ldmacho(Biobuf *f, char *pkg, int64 len, char *pn) ...@@ -507,6 +507,7 @@ ldmacho(Biobuf *f, char *pkg, int64 len, char *pn)
c = nil; c = nil;
symtab = nil; symtab = nil;
dsymtab = nil; dsymtab = nil;
USED(dsymtab);
for(i=0; i<ncmd; i++){ for(i=0; i<ncmd; i++){
ty = e->e32(cmdp); ty = e->e32(cmdp);
sz = e->e32(cmdp+4); sz = e->e32(cmdp+4);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment