Commit dbec4210 authored by Anthony Martin's avatar Anthony Martin

gc, 8g, 8l: fix a handful of warnings

8g/cgen.c
        print format type mismatch

8l/asm.c
        resoff set and not used

gc/pgen.c
        misleading comparison INT > 0x80000000

gc/reflect.c
        dalgsym must be static to match forward declaration

gc/subr.c
        assumed_equal set and not used
        hashmem's second argument is not used

gc/walk.c
        duplicated (unreachable) code

R=rsc
CC=golang-dev
https://golang.org/cl/5651079
parent c53b7345
...@@ -1146,7 +1146,7 @@ sgen(Node *n, Node *res, int64 w) ...@@ -1146,7 +1146,7 @@ sgen(Node *n, Node *res, int64 w)
int32 c, q, odst, osrc; int32 c, q, odst, osrc;
if(debug['g']) { if(debug['g']) {
print("\nsgen w=%ld\n", w); print("\nsgen w=%lld\n", w);
dump("r", n); dump("r", n);
dump("res", res); dump("res", res);
} }
......
...@@ -1004,6 +1004,9 @@ asmb(void) ...@@ -1004,6 +1004,9 @@ asmb(void)
phsh(ph, sh); phsh(ph, sh);
} }
// Additions to the reserved area must be above this line.
USED(resoff);
elfphload(&segtext); elfphload(&segtext);
elfphload(&segdata); elfphload(&segdata);
......
...@@ -124,7 +124,7 @@ compile(Node *fn) ...@@ -124,7 +124,7 @@ compile(Node *fn)
print("allocauto: %lld to %lld\n", oldstksize, (vlong)stksize); print("allocauto: %lld to %lld\n", oldstksize, (vlong)stksize);
setlineno(curfn); setlineno(curfn);
if(stksize+maxarg > (1ULL<<31)) if((int64)stksize+maxarg > (1ULL<<31))
yyerror("stack frame too large (>2GB)"); yyerror("stack frame too large (>2GB)");
defframe(ptxt); defframe(ptxt);
......
...@@ -907,7 +907,7 @@ dumptypestructs(void) ...@@ -907,7 +907,7 @@ dumptypestructs(void)
} }
} }
Sym* static Sym*
dalgsym(Type *t) dalgsym(Type *t)
{ {
int ot; int ot;
......
...@@ -1108,11 +1108,9 @@ eqtype1(Type *t1, Type *t2, TypePairList *assumed_equal) ...@@ -1108,11 +1108,9 @@ eqtype1(Type *t1, Type *t2, TypePairList *assumed_equal)
goto no; goto no;
yes: yes:
assumed_equal = l.next;
return 1; return 1;
no: no:
assumed_equal = l.next;
return 0; return 0;
} }
...@@ -2491,7 +2489,7 @@ genwrapper(Type *rcvr, Type *method, Sym *newnam, int iface) ...@@ -2491,7 +2489,7 @@ genwrapper(Type *rcvr, Type *method, Sym *newnam, int iface)
} }
static Node* static Node*
hashmem(Type *t, vlong width) hashmem(Type *t)
{ {
Node *tfn, *n; Node *tfn, *n;
Sym *sym; Sym *sym;
...@@ -2519,7 +2517,7 @@ hashfor(Type *t) ...@@ -2519,7 +2517,7 @@ hashfor(Type *t)
a = algtype1(t, nil); a = algtype1(t, nil);
switch(a) { switch(a) {
case AMEM: case AMEM:
return hashmem(t, t->width); return hashmem(t);
case AINTER: case AINTER:
sym = pkglookup("interhash", runtimepkg); sym = pkglookup("interhash", runtimepkg);
break; break;
...@@ -2667,7 +2665,7 @@ genhash(Sym *sym, Type *t) ...@@ -2667,7 +2665,7 @@ genhash(Sym *sym, Type *t)
size = t->width - first->width; // first->width is offset size = t->width - first->width; // first->width is offset
else else
size = t1->width - first->width; // both are offsets size = t1->width - first->width; // both are offsets
hashel = hashmem(first->type, size); hashel = hashmem(first->type);
// hashel(h, size, &p.first) // hashel(h, size, &p.first)
call = nod(OCALL, hashel, N); call = nod(OCALL, hashel, N);
call->list = list(call->list, nh); call->list = list(call->list, nh);
......
...@@ -1194,10 +1194,6 @@ walkexpr(Node **np, NodeList **init) ...@@ -1194,10 +1194,6 @@ walkexpr(Node **np, NodeList **init)
n = r; n = r;
goto ret; goto ret;
n = r;
goto ret;
case OARRAYLIT: case OARRAYLIT:
case OMAPLIT: case OMAPLIT:
case OSTRUCTLIT: case OSTRUCTLIT:
......
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