diff options
author | Marek Polacek <polacek@redhat.com> | 2014-05-08 17:42:09 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-05-08 17:42:09 +0000 |
commit | f827930ae282f8ae4bedf0a38dbc2fa99d2b3d08 (patch) | |
tree | 761bbf96a5b2bd42adfa8daa925ffb28083fc9f5 /gcc/c-family/c-common.c | |
parent | f0fd118f53ae2ba7384a94c6821458275e6c226c (diff) | |
download | gcc-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-family/c-common.c')
-rw-r--r-- | gcc/c-family/c-common.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 0afe2f5..33ad250 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -2193,6 +2193,20 @@ check_main_parameter_types (tree decl) if (type == void_type_node || type == error_mark_node ) break; + tree t = type; + if (TYPE_ATOMIC (t)) + pedwarn (input_location, OPT_Wmain, + "%<_Atomic%>-qualified parameter type %qT of %q+D", + type, decl); + while (POINTER_TYPE_P (t)) + { + t = TREE_TYPE (t); + if (TYPE_ATOMIC (t)) + pedwarn (input_location, OPT_Wmain, + "%<_Atomic%>-qualified parameter type %qT of %q+D", + type, decl); + } + ++argct; switch (argct) { |