1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:14:42 -07:00

cc: broken return is an error, not a warning

R=ken2
CC=golang-dev
https://golang.org/cl/4626081
This commit is contained in:
Russ Cox 2011-06-28 16:00:55 -04:00
parent 997c00f991
commit d0ac84fe40
2 changed files with 2 additions and 2 deletions

View File

@ -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))

View File

@ -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);