]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc, cmd/ld: fix Plan 9 warnings
authorDavid du Colombier <0intro@gmail.com>
Wed, 22 Jan 2014 20:21:18 +0000 (21:21 +0100)
committerDavid du Colombier <0intro@gmail.com>
Wed, 22 Jan 2014 20:21:18 +0000 (21:21 +0100)
warning: /usr/go/src/cmd/gc/obj.c:23 format mismatch -10d VLONG, arg 9
warning: /usr/go/src/cmd/gc/plive.c:1680 set and not used: printed
warning: /usr/go/src/cmd/ld/lib.c:332 non-interruptable temporary
warning: /usr/go/src/cmd/ld/lib.c:338 non-interruptable temporary

R=rsc
CC=golang-codereviews
https://golang.org/cl/53820046

src/cmd/gc/obj.c
src/cmd/gc/plive.c
src/cmd/ld/lib.c

index c6ba367647c7173b17d68b6c779c325b19c8f2c6..635a30d4027e293c05f3e582d0e21c648afe48fd 100644 (file)
@@ -20,7 +20,7 @@ enum
 static void
 formathdr(char *arhdr, char *name, vlong size)
 {
-       snprint(arhdr, ArhdrSize, "%-16s%-12d%-6d%-6d%-8o%-10d`",
+       snprint(arhdr, ArhdrSize, "%-16s%-12d%-6d%-6d%-8o%-10lld`",
                name, 0, 0, 0, 0644, size);
        arhdr[ArhdrSize-1] = '\n'; // overwrite \0 written by snprint
 }
index fb0d7687abc49a6d1b4b76fa61da6d942e0fbcab..27eac707e16743c8f22834ce3a3c885d0e9d0942 100644 (file)
@@ -1676,10 +1676,9 @@ printbitset(int printed, char *name, Array *vars, Bvec *bits)
                if(!bvget(bits, i))
                        continue;
                if(!started) {
-                       if(!printed) {
-                               printed = 1;
+                       if(!printed)
                                print("\t");
-                       else
+                       else
                                print(" ");
                        started = 1;
                        printed = 1;
index 98fa7aa48233f762e40da4bbd0a3348297180b9d..ac2417ee66f9030ae11d12019bf8d651127cda40 100644 (file)
@@ -329,13 +329,15 @@ objfile(char *file, char *pkg)
        
        /* skip over optional __.GOSYMDEF and process __.PKGDEF */
        off = Boffset(f);
-       if((l = nextar(f, off, &arhdr)) <= 0) {
+       l = nextar(f, off, &arhdr);
+       if(l <= 0) {
                diag("%s: short read on archive file symbol header", file);
                goto out;
        }
        if(strncmp(arhdr.name, symname, strlen(symname)) == 0) {
                off += l;
-               if((l = nextar(f, off, &arhdr)) <= 0) {
+               l = nextar(f, off, &arhdr);
+               if(l <= 0) {
                        diag("%s: short read on archive file symbol header", file);
                        goto out;
                }