From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107198 invoked by alias); 28 Sep 2015 17:07:48 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 107161 invoked by uid 55); 28 Sep 2015 17:07:43 -0000 From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/67730] [5/6 Regression] No warning when returning NULL in void function Date: Mon, 28 Sep 2015 17:07:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 5.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-09/txt/msg02207.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67730 --- Comment #1 from 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.