]> Cypherpunks repositories - gostls13.git/commitdiff
build: use gcc -Werror
authorRuss Cox <rsc@golang.org>
Wed, 13 Apr 2011 20:18:09 +0000 (16:18 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 13 Apr 2011 20:18:09 +0000 (16:18 -0400)
Better to fix the warnings that we find.

R=iant
CC=golang-dev
https://golang.org/cl/4406042

src/cmd/5c/peep.c
src/cmd/5c/txt.c
src/cmd/6c/peep.c
src/cmd/6c/txt.c
src/cmd/8c/peep.c
src/cmd/8c/txt.c
src/quietgcc.bash

index 8945ee73214d7ad7be698fb471a69ab27eb8b976..c15bf0fc4cd499180a48ca13ffcebb47e5b3a8c7 100644 (file)
@@ -1100,7 +1100,7 @@ copyu(Prog *p, Adr *v, Adr *s)
                if(v->type == D_REG) {
                        if(v->reg <= REGEXT && v->reg > exregoffset)
                                return 2;
-                       if(v->reg == REGARG)
+                       if(v->reg == (uchar)REGARG)
                                return 2;
                }
                if(v->type == D_FREG)
@@ -1118,7 +1118,7 @@ copyu(Prog *p, Adr *v, Adr *s)
 
        case ATEXT:     /* funny */
                if(v->type == D_REG)
-                       if(v->reg == REGARG)
+                       if(v->reg == (uchar)REGARG)
                                return 3;
                return 0;
        }
index f5619f80041ed031d6ec291d8e06213197b8b1ac..4be1f6f6203091996f2ab6a97ba41a3d1c29fd75 100644 (file)
@@ -400,6 +400,10 @@ regsalloc(Node *n, Node *nn)
 void
 regaalloc1(Node *n, Node *nn)
 {
+       if(REGARG < 0) {
+               fatal(n, "regaalloc1 and REGARG<0");
+               return;
+       }
        nodreg(n, nn, REGARG);
        reg[REGARG]++;
        curarg = align(curarg, nn->type, Aarg1, nil);
index 13fd25e73727042e641ca620789bbb348f450fbd..8b82adbf56c39111cadb5fca08ba0ae9100a5c90 100644 (file)
@@ -797,7 +797,7 @@ copyu(Prog *p, Adr *v, Adr *s)
                return 3;
 
        case ACALL:     /* funny */
-               if(REGARG >= 0 && v->type == REGARG)
+               if(REGARG >= 0 && v->type == (uchar)REGARG)
                        return 2;
 
                if(s != A) {
@@ -810,7 +810,7 @@ copyu(Prog *p, Adr *v, Adr *s)
                return 3;
 
        case ATEXT:     /* funny */
-               if(REGARG >= 0 && v->type == REGARG)
+               if(REGARG >= 0 && v->type == (uchar)REGARG)
                        return 3;
                return 0;
        }
index a78ba227bcb585c914ac9c945477d01d47eb9fbc..12fc5b498a5e80caea93e4526da0b3a409bfa4be 100644 (file)
@@ -436,8 +436,10 @@ regsalloc(Node *n, Node *nn)
 void
 regaalloc1(Node *n, Node *nn)
 {
-       if(REGARG < 0)
-               diag(n, "regaalloc1 and REGARG<0");
+       if(REGARG < 0) {
+               fatal(n, "regaalloc1 and REGARG<0");
+               return;
+       }
        nodreg(n, nn, REGARG);
        reg[REGARG]++;
        curarg = align(curarg, nn->type, Aarg1, nil);
index 9e18fc94d2dc90d9545f5ef067c757b64da3ab6d..9511a5579e685d6c5da0e41bdef31c33176300aa 100644 (file)
@@ -713,7 +713,7 @@ copyu(Prog *p, Adr *v, Adr *s)
                return 3;
 
        case ACALL:     /* funny */
-               if(REGARG >= 0 && v->type == REGARG)
+               if(REGARG >= 0 && v->type == (uchar)REGARG)
                        return 2;
 
                if(s != A) {
index 0dd387d11aef357558d31fee629451648bc63da7..b2e0148a0a55bf243684d7c6729301e88d2803cd 100644 (file)
@@ -397,6 +397,10 @@ regsalloc(Node *n, Node *nn)
 void
 regaalloc1(Node *n, Node *nn)
 {
+       if(REGARG < 0) {
+               fatal(n, "regaalloc1 and REGARG<0");
+               return;
+       }
        nodreg(n, nn, REGARG);
        reg[REGARG]++;
        curarg = align(curarg, nn->type, Aarg1, nil);
index 748fc593e05cd1c3bf9bb9276d2b7f4021628a00..e29ee4f6428770e8dfdcbb19a6e358117ab1b5d9 100755 (executable)
@@ -35,15 +35,10 @@ esac
 tmp=/tmp/qcc.$$.$USER.out
 $gcc -Wall -Wno-sign-compare -Wno-missing-braces \
        -Wno-parentheses -Wno-unknown-pragmas -Wno-switch -Wno-comment \
+       -Werror \
        "$@" >$tmp 2>&1
 status=$?
 egrep -v "$ignore" $tmp | uniq | tee $tmp.1
 
-# Make incompatible pointer type "warnings" stop the build.
-# Not quite perfect--we should remove the object file--but
-# a step in the right direction.
-if egrep 'incompatible pointer type' $tmp.1 >/dev/null; then
-       status=1
-fi
 rm -f $tmp $tmp.1
 exit $status