Bug 2217542
| Summary: | The cppcheck-2.11-1.fc39 fails on gettext.h with returnDanglingLifetime | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Jiri Konecny <jkonecny> |
| Component: | gettext | Assignee: | Jens Petersen <petersen> |
| Status: | ASSIGNED --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 39 | CC: | dueno, i18n-bugs, nphilipp, petersen, suanand |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| URL: | https://github.com/rhinstaller/anaconda/actions/runs/5378586167/jobs/9758588667#step:4:2099 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
I am wondering: is it the new version of cppcheck or the new version of gettext? Hi seems to be cppcheck version specific. The version of gettext did not changed during the success -> failure period. Both the failure and successful checks were testing gettext-devel x86_64 0.21.1-3.fc39 Thanks Jiri for clarifying I see the error for gettext-0.21.1 and gettext0.22 (0.21 seems okay). The source file is "gettext-runtime/gnulib-lib/gettext.h". I reported it to bug-gettext - depending on the response I may open a bug in savannah too. According the reply I got from Bruno Haible: https://lists.gnu.org/archive/html/bug-gettext/2023-07/msg00003.html this should be a false positive. Should it be reported to cppcheck then? Sounds reasonable to me. Maybe switching this bug to cppcheck for them to find out if this is a bug in cppcheck or not. This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle. Changing version to 39. |
On Rawhide cppcheck was recently updated and now we are getting returnDanglingLifetime error from it on copied gettext.h file from /usr/share/gettext/gettext.h path. Version of cppcheck which shows this issue: 2.11-1.fc39 Last version of cppcheck which worked well: 2.9-4.fc38 I don't know if the error is valid or not... Reproducible: Always Steps to Reproduce: 1. podman run --rm -it fedora:rawhide 2. dnf install -y cppcheck gettext-devel 3. cppcheck -q -v /usr/share/gettext/gettext.h Actual Results: /usr/share/gettext/gettext.h:248:16: error: Returning pointer to local variable 'msg_ctxt_id' that will be invalid when returning. [returnDanglingLifetime] return translation; Expected Results: No error