Commit d0ac84fe authored by Russ Cox's avatar Russ Cox

cc: broken return is an error, not a warning

R=ken2
CC=golang-dev
https://golang.org/cl/4626081
parent 997c00f9
......@@ -127,7 +127,7 @@ tcomo(Node *n, int f)
case ORETURN:
if(l == Z) {
if(n->type->etype != TVOID)
warn(n, "null return of a typed function");
diag(n, "null return of a typed function");
break;
}
if(tcom(l))
......
......@@ -112,7 +112,7 @@ codgen(Node *n, Node *nn)
warnreach = 1;
gen(n);
if(canreach && thisfn->link->etype != TVOID)
warn(Z, "no return at end of function: %s", n1->sym->name);
diag(Z, "no return at end of function: %s", n1->sym->name);
noretval(3);
gbranch(ORETURN);
......
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