aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2014-05-08 17:42:09 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2014-05-08 17:42:09 +0000
commitf827930ae282f8ae4bedf0a38dbc2fa99d2b3d08 (patch)
tree761bbf96a5b2bd42adfa8daa925ffb28083fc9f5 /gcc/c/c-decl.c
parentf0fd118f53ae2ba7384a94c6821458275e6c226c (diff)
downloadgcc-f827930ae282f8ae4bedf0a38dbc2fa99d2b3d08.zip
gcc-f827930ae282f8ae4bedf0a38dbc2fa99d2b3d08.tar.gz
gcc-f827930ae282f8ae4bedf0a38dbc2fa99d2b3d08.tar.bz2
re PR c/61077 (_Atomic in the return type or argument types of main not diagnosed)
PR c/61077 c-family/ * c-common.c (check_main_parameter_types): Warn for _Atomic-qualified parameter type of main. c/ * c-decl.c (start_function): Warn for _Atomic-qualified return type of main. testsuite/ * gcc.dg/pr61077.c: New test. From-SVN: r210229
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r--gcc/c/c-decl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 3abf6b9..d8631fc 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -8045,6 +8045,9 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl1)))
!= integer_type_node)
pedwarn (loc, OPT_Wmain, "return type of %qD is not %<int%>", decl1);
+ else if (TYPE_ATOMIC (TREE_TYPE (TREE_TYPE (decl1))))
+ pedwarn (loc, OPT_Wmain, "%<_Atomic%>-qualified return type of %qD",
+ decl1);
check_main_parameter_types (decl1);