mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-27 19:05:47 +08:00
* c-decl.c (grokdeclarator): Pedwarn qualified void function return type.
From-SVN: r13802
This commit is contained in:
parent
9ab8cffd48
commit
ae998c9a69
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user