]> Cypherpunks repositories - gostls13.git/commitdiff
cc: broken return is an error, not a warning
authorRuss Cox <rsc@golang.org>
Tue, 28 Jun 2011 20:00:55 +0000 (16:00 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 28 Jun 2011 20:00:55 +0000 (16:00 -0400)
R=ken2
CC=golang-dev
https://golang.org/cl/4626081

src/cmd/cc/com.c
src/cmd/cc/pgen.c

index b1a8a47041e7ca1a9faddd4ed0d62597a97171f4..192c28ace6d87cf0a7bd5afc6718ba9e5a80321c 100644 (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))
index 5d17cafc92fbb49988891768908235bf74ca12cf..0e5e8c059dd32ea557df8dc21bfac182db9c9a2b 100644 (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);