mirror of
https://github.com/golang/go
synced 2024-11-19 14:54:43 -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:
parent
997c00f991
commit
d0ac84fe40
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user