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 | |
| 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')
| -rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/c-family/c-common.c | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index b7c65d3..06a1b14 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2014-05-08 Marek Polacek <polacek@redhat.com> + + PR c/61077 + * c-common.c (check_main_parameter_types): Warn for _Atomic-qualified + parameter type of main. + 2014-05-07 DJ Delorie <dj@redhat.com> * c-cppbuiltin.c (print_bits_of_hex): New. 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) { |
