From 1c7485afda66c17e00d3dcdce2ef9bf9106d3cda Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 2 Oct 2015 18:01:50 +0000 Subject: re PR c/67730 (No warning when returning NULL in void function) PR c/67730 * c-typeck.c (convert_for_assignment): Use the expansion point location throughout. * gcc.dg/pr67730-1.c: New test. * gcc.dg/pr67730-2.c: New test. * gcc.dg/pr67730.h: New test. From-SVN: r228408 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-typeck.c | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 7c0051f..c6eab4e 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,5 +1,11 @@ 2015-10-02 Marek Polacek + PR c/67730 + * c-typeck.c (convert_for_assignment): Use the expansion point + location throughout. + +2015-10-02 Marek Polacek + PR c/64249 * c-parser.c (c_parser_statement_after_labels): Add CHAIN parameter and pass it down to c_parser_if_statement. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 11e487c..ad02d6c 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -5718,6 +5718,10 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type, tree rname = NULL_TREE; bool objc_ok = false; + /* Use the expansion point location to handle cases such as user's + function returning a wrong-type macro defined in a system header. */ + location = expansion_point_location_if_in_system_header (location); + if (errtype == ic_argpass) { tree selector; -- cgit v1.1