This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C PATCH] Improve warn msg (PR c/43395)


On 04/29/14 15:17, Marek Polacek wrote:
It's correct to warn about returning an address of a local label,
but it's clumsy to say it's "local variable.  We can easily distinguish
between a label and a variable.

Regtested/bootstrapped on x86_64-linux, ok for trunk?

2014-04-29  Marek Polacek  <polacek@redhat.com>

	PR c/43395
c/
	* c-typeck.c (c_finish_return): Distinguish between label and variable
	when warning about returning local address.
cp/
	* typeck.c (maybe_warn_about_returning_address_of_local): Distinguish
	between label and variable when warning about returning local address.
testsuite/
	* c-c++-common/pr43395.c: New test.
OK.  Thanks.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]