Commit ae998c9a by Doug Evans

* c-decl.c (grokdeclarator): Pedwarn qualified void function return type.

From-SVN: r13802
parent 9ab8cffd
......@@ -5031,6 +5031,13 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
&& ! DECL_IN_SYSTEM_HEADER (decl))
pedwarn ("ANSI C forbids const or volatile functions");
if (pedantic
&& TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl))) == void_type_node
&& (TYPE_READONLY (TREE_TYPE (TREE_TYPE (decl)))
|| TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (decl))))
&& ! DECL_IN_SYSTEM_HEADER (decl))
pedwarn ("ANSI C forbids const or volatile void function return type");
if (volatilep
&& TREE_TYPE (TREE_TYPE (decl)) != void_type_node)
warning ("`noreturn' function returns non-void value");
......
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