This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/67730] [5/6 Regression] No warning when returning NULL in void function
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Sep 2015 17:07:43 +0000
- Subject: [Bug c/67730] [5/6 Regression] No warning when returning NULL in void function
- Auto-submitted: auto-generated
- References: <bug-67730-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67730
--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
Probably caused by:
r211978 | mpolacek | 2014-06-25 12:43:05 +0000 (Wed, 25 Jun 2014) | 7
lines
PR c/61162
* c-parser.c (c_parser_statement_after_labels): Pass the location of
the return expression to c_finish_return.
* gcc.dg/pr61162.c: Adjust dg-warning.
* gcc.dg/pr61162-2.c: New test.
For this warning, either it should use the location of the return keyword,
or (maybe better) it should use the location of the return value before
macro expansion - not the location of the macro definition - since this
diagnostic is about the context in which the expression is used, not the
contents of that expression.