bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cppcheck-2.11 error for gettext.h


From: Jens-Ulrik Petersen
Subject: Re: cppcheck-2.11 error for gettext.h
Date: Tue, 4 Jul 2023 18:29:35 +0800

Hi Bruno,

On Tue, Jul 4, 2023 at 3:36 PM Bruno Haible <bruno@clisp.org> wrote:
Jens-Ulrik Petersen wrote:
> gettext.h:248:16: error: Returning pointer to local variable 'msg_ctxt_id'
> that will be invalid when returning. [returnDanglingLifetime]
>         return translation;
>                ^

dcgettext (domain, msg_ctxt_id, category) always returns either the second
argument, or a string that has indefinite extent. It never returns something
like msg_ctxt_id + some_offset. [1]

Thus this "error" is a false alarm.

I see, thank you.

> This seems to have started happening with gettext-0.21.1 and later, at
> least for Fedora. Also needs cppcheck-2.11 (the error doesn't show with
> 2.9).

Why do you suggest that maybe this is caused by a gettext upgrade, when
the original reporter already found out that this is not the case?
https://bugzilla.redhat.com/show_bug.cgi?id=2217542#c2

I think the reporter meant that the result is the same between 0.21.1 and 0.22.
But I didn't see it for gettext-0.21.

[1] https://www.gnu.org/software/libc/manual/html_node/Translation-with-gettext.html


reply via email to

[Prev in Thread] Current Thread [Next in Thread]