]> Cypherpunks repositories - gostls13.git/commitdiff
function wo return is an error - not warning
authorKen Thompson <ken@golang.org>
Thu, 11 Sep 2008 22:44:45 +0000 (15:44 -0700)
committerKen Thompson <ken@golang.org>
Thu, 11 Sep 2008 22:44:45 +0000 (15:44 -0700)
R=r
OCL=15169
CL=15169

src/cmd/gc/walk.c

index abb7ce0bd808e5f6085619010b1eaf4ac332a909..8850867db760ec16ca02b4c7a589741d7e23450c 100644 (file)
@@ -54,7 +54,7 @@ walk(Node *fn)
        }
        if(curfn->type->outtuple)
                if(walkret(curfn->nbody))
-                       warn("function ends without a return statement");
+                       yyerror("function ends without a return statement");
        walkstate(curfn->nbody);
        if(debug['W']) {
                snprint(s, sizeof(s), "after %S", curfn->nname->sym);