summaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-06-28 16:00:55 -0400
committerRuss Cox <rsc@golang.org>2011-06-28 16:00:55 -0400
commit71fad73fcac7d1cb62e3c6d09152896b2174a9f1 (patch)
tree9f2f49f52c07a04d1bec924cf9f4bb6762b2d229 /src/cmd
parent3fc56a2c565434ecb929e355521a9410b3c473c0 (diff)
downloadgo-71fad73fcac7d1cb62e3c6d09152896b2174a9f1.tar.gz
cc: broken return is an error, not a warning
R=ken2 CC=golang-dev http://codereview.appspot.com/4626081
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/cc/com.c2
-rw-r--r--src/cmd/cc/pgen.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/cc/com.c b/src/cmd/cc/com.c
index b1a8a4704..192c28ace 100644
--- a/src/cmd/cc/com.c
+++ b/src/cmd/cc/com.c
@@ -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))
diff --git a/src/cmd/cc/pgen.c b/src/cmd/cc/pgen.c
index 5d17cafc9..0e5e8c059 100644
--- a/src/cmd/cc/pgen.c
+++ b/src/cmd/cc/pgen.c
@@ -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);