|
From: | Jens-Ulrik Petersen |
Subject: | Re: cppcheck-2.11 error for gettext.h |
Date: | Tue, 4 Jul 2023 18:29:35 +0800 |
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.
> 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
[1] https://www.gnu.org/software/libc/manual/html_node/Translation-with-gettext.html
[Prev in Thread] | Current Thread | [Next in Thread] |