]> git.ipfire.org Git - thirdparty/gcc.git/commit
2018-05-30 David Pagan <dave.pagan@oracle.com>
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 May 2018 22:55:38 +0000 (22:55 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 May 2018 22:55:38 +0000 (22:55 +0000)
commit768cc20ebfeb92b2f765eb7365e60bc63be32aac
treebd00a7c76e46ddf69b97e2eb349f2abd1e3a4325
parent842b575acb582751708c78b890851f3e4233fa96
2018-05-30  David Pagan  <dave.pagan@oracle.com>

PR c/55976
* c-decl.c (grokdeclarator): Update check for return type warnings.
(start_function): Likewise.
(finish_function): Likewise.
* c-typeck.c (c_finish_return): Update check for return type warnings.
Pass OPT_Wreturn_type to pedwarn when appropriate.

PR c/55976
* c-opts.c (c_common_post_options): Set default for warn_return_type
for C++/C++ with ObjC extensions only. For C, makes it possible to
differentiate between default (no option), -Wreturn-type, and
-Wno-return-type.

PR c/55976
* gcc.dg/noncompile/pr55976-1.c: New test.
* gcc.dg/noncompile/pr55976-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260978 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/c-family/ChangeLog
gcc/c-family/c-opts.c
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/noncompile/pr55976-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/noncompile/pr55976-2.c [new file with mode: 0644]