This is the mail archive of the
mailing list for the GCC project.
Re: Warn when returning the address of a temporary (middle-end) v2
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: Richard Sandiford <rdsandiford at googlemail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 27 Jul 2014 21:45:00 +0200
- Subject: Re: Warn when returning the address of a temporary (middle-end) v2
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 02 dot 1406221930380 dot 20514 at stedding dot saclay dot inria dot fr> <87fvhmllc5 dot fsf at talisman dot default> <alpine dot DEB dot 2 dot 11 dot 1407272034080 dot 6979 at laptop-mg dot saclay dot inria dot fr>
Marc Glisse <firstname.lastname@example.org> writes:
> On Sun, 27 Jul 2014, Richard Sandiford wrote:
>> Marc Glisse <email@example.com> writes:
>>> + if (always_executed)
>>> + msg = "function returns address of local variable";
>>> + else
>>> + msg = "function may return address of local variable";
>> I think you need _(...) here, unless some magic makes that unnecessary now.
> I just tried to see how the magic happens when someone calls error_at, and
> it goes through diagnostic_set_info, which contains:
> diagnostic_set_info_translated (diagnostic, _(gmsgid), args, location, kind);
> So I think the _(...) is already taken care of. But I don't know that code
> at all and I could easily have looked at it wrong.
If the msgid is not a direct argument of the diagnostic function you
need to mark the string with N_(...).
Andreas Schwab, firstname.lastname@example.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."