summaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.c
diff options
context:
space:
mode:
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-08 17:42:09 +0000
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-08 17:42:09 +0000
commit2026249a8c3edf097e9f15a6a10ddc203e7b23ba (patch)
tree761bbf96a5b2bd42adfa8daa925ffb28083fc9f5 /gcc/c/c-decl.c
parent385aec5ac5337d6aa99d27df476e642a4e67c5c1 (diff)
downloadgcc-2026249a8c3edf097e9f15a6a10ddc203e7b23ba.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210229 138bc75d-0d04-0410-961f-82ee72b054a4
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 3abf6b98574..d8631fc3345 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);