+2014-05-02 Marek Polacek <polacek@redhat.com>
+
+ * c-typeck.c (c_finish_return): Separate warning_at calls.
+
2014-05-02 Marek Polacek <polacek@redhat.com>
* c-tree.h (error_init): Remove declaration.
&& !DECL_EXTERNAL (inner)
&& !TREE_STATIC (inner)
&& DECL_CONTEXT (inner) == current_function_decl)
- warning_at (loc,
- OPT_Wreturn_local_addr, "function returns address "
- "of %s", TREE_CODE (inner) == LABEL_DECL
- ? "label" : "local variable");
+ {
+ if (TREE_CODE (inner) == LABEL_DECL)
+ warning_at (loc, OPT_Wreturn_local_addr,
+ "function returns address of label");
+ else
+ warning_at (loc, OPT_Wreturn_local_addr,
+ "function returns address of local variable");
+ }
break;
default:
+2014-05-02 Marek Polacek <polacek@redhat.com>
+
+ * typeck.c (maybe_warn_about_returning_address_of_local): Separate
+ warning_at calls.
+
2014-05-01 Marek Polacek <polacek@redhat.com>
PR c/43395
if (TREE_CODE (valtype) == REFERENCE_TYPE)
warning (OPT_Wreturn_local_addr, "reference to local variable %q+D returned",
whats_returned);
+ else if (TREE_CODE (whats_returned) == LABEL_DECL)
+ warning (OPT_Wreturn_local_addr, "address of label %q+D returned",
+ whats_returned);
else
- warning (OPT_Wreturn_local_addr, "address of %s %q+D returned",
- TREE_CODE (whats_returned) == LABEL_DECL
- ? "label" : "local variable", whats_returned);
+ warning (OPT_Wreturn_local_addr, "address of local variable %q+D "
+ "returned", whats_returned);
return;
}
}