aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index e04a38d..f0630e2 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,5 +1,11 @@
2014-05-01 Marek Polacek <polacek@redhat.com>
+ PR c/43395
+ * c-typeck.c (c_finish_return): Distinguish between label and variable
+ when warning about returning local address.
+
+2014-05-01 Marek Polacek <polacek@redhat.com>
+
PR c/29467
* c-decl.c (declspecs_add_type): Pedwarn if boolean types are used
in C89 mode.
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index e25a25c..2a40c70 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -9265,7 +9265,8 @@ c_finish_return (location_t loc, tree retval, tree origtype)
&& DECL_CONTEXT (inner) == current_function_decl)
warning_at (loc,
OPT_Wreturn_local_addr, "function returns address "
- "of local variable");
+ "of %s", TREE_CODE (inner) == LABEL_DECL
+ ? "label" : "local variable");
break;
default: