Commit e7c692b2 by Richard Kenner

(c_expand_return): Do not warn about returning the address of a

locally declared extern variable.

From-SVN: r6526
parent 5921f26b
......@@ -6239,6 +6239,7 @@ c_expand_return (retval)
inner = TREE_OPERAND (inner, 0);
if (TREE_CODE (inner) == VAR_DECL
&& ! DECL_EXTERNAL (inner)
&& ! TREE_STATIC (inner)
&& DECL_CONTEXT (inner) == current_function_decl)
warning ("function returns address of local variable");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment