[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cppcheck-2.11 error for gettext.h
From: |
Bruno Haible |
Subject: |
Re: cppcheck-2.11 error for gettext.h |
Date: |
Tue, 04 Jul 2023 09:36:51 +0200 |
Hi,
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
> Sorry I am a little ignorant here, does that mean it is a gnulib issue or
> gettext?
> I can report this to gnulib if that is the right place, or perhaps someone
> could cross-post it for me?
Reporting it to bug-gettext, like you did, is fine.
Bruno
[1]
https://www.gnu.org/software/libc/manual/html_node/Translation-with-gettext.html