Commit 1d26908d authored by Russ Cox's avatar Russ Cox

build: use gcc -Werror

Better to fix the warnings that we find.

R=iant
CC=golang-dev
https://golang.org/cl/4406042
parent da8c5e72
......@@ -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;
}
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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
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