Bug 1907031
| Summary: | FTBFS: kdelibs on Rawhide (gcc 11) | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Richard Shaw <hobbes1069> |
| Component: | kdelibs | Assignee: | Kevin Kofler <kevin> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | jgrulich, jreznik, kde-sig, kevin, law, me, rdieter, smparrish, than |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-12-13 15:10:38 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Richard Shaw
2020-12-12 13:14:33 UTC
This code is a leftover from Qt 3 times: In Qt 3, QString::contains returned an int, the number of times the character occurs in the string. In Qt 4, QString::contains was changed to return a bool instead (which is still the case in Qt 5). The fix is to remove the "> 0" in both lines. This bug is still present in the copy of the code in KF5 kdelibs4support: https://invent.kde.org/frameworks/kdelibs4support/-/blob/ff85d52bb12300cceb30492b2aff3e4692644e1c/src/kdecore/klocale_kde.cpp#L2125 This should be fixed now as well as a minor const-correctness issue. Well, the != 0 checks don't really make sense semantically because contains actually returns a boolean. What happens there is that the Qt methods actually return a magic internal class that implicitly converts to both bool and void *, exactly so that legacy code that has explicit != 0 checks still works (and with GCC < 11, one got away even with > 0 checks), but it's still legacy. :-) That's the most direct fix without changing the meaning of the existing code. Someone with a better understanding of the QT interfaces may well have a better fix. |