]> Cypherpunks repositories - gostls13.git/commitdiff
gc, 8g, 8l: fix a handful of warnings
authorAnthony Martin <ality@pbrane.org>
Mon, 13 Feb 2012 07:07:31 +0000 (23:07 -0800)
committerAnthony Martin <ality@pbrane.org>
Mon, 13 Feb 2012 07:07:31 +0000 (23:07 -0800)
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

src/cmd/8g/cgen.c
src/cmd/8l/asm.c
src/cmd/gc/pgen.c
src/cmd/gc/reflect.c
src/cmd/gc/subr.c
src/cmd/gc/walk.c

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