From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7426 invoked by alias); 27 Jul 2014 20:50:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7410 invoked by uid 89); 27 Jul 2014 20:50:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail2-relais-roc.national.inria.fr Received: from mail2-relais-roc.national.inria.fr (HELO mail2-relais-roc.national.inria.fr) (192.134.164.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sun, 27 Jul 2014 20:50:04 +0000 Received: from ip-205.net-81-220-140.rev.numericable.fr (HELO laptop-mg.local) ([81.220.140.205]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Jul 2014 22:50:00 +0200 Date: Sun, 27 Jul 2014 21:05:00 -0000 From: Marc Glisse To: Andreas Schwab cc: Richard Sandiford , gcc-patches@gcc.gnu.org Subject: Re: Warn when returning the address of a temporary (middle-end) v2 In-Reply-To: <87ha22twlf.fsf@igel.home> Message-ID: References: <87fvhmllc5.fsf@talisman.default> <87ha22twlf.fsf@igel.home> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-SW-Source: 2014-07/txt/msg01855.txt.bz2 On Sun, 27 Jul 2014, Andreas Schwab wrote: > Marc Glisse writes: > >> On Sun, 27 Jul 2014, Richard Sandiford wrote: >> >>> Marc Glisse 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_(...). Ah, ok, thanks. Actually, shouldn't it be G_ instead? That's what ABOUT-GCC-NLS seems to suggest since 2005, though I don't expect it makes any difference for simple strings. -- Marc Glisse