[Rpm-maint] [rpm-software-management/rpm] `rpmfcFileDep::operator<` should be `const` (PR #3951)
Panu Matilainen
notifications at github.com
Fri Sep 19 06:33:50 UTC 2025
pmatilai left a comment (rpm-software-management/rpm#3951)
Oh. This piece of background information is something I wish that would've been communicated up front and gone into the commit messages as well.
We've never ran clang-tidy on this project, so it's no wonder it's unhappy :sweat_smile:
And, with such tools there's always style issues and false positives, and that's exactly what the delete on nullptr is: a false positive. There's no sense moving it outside the existing check as long as the null-check is needed for other reasons, it only makes the code look weird IMO. That particular issue would go away in a more meaningful manner by turning rpmcpio into an object with a constructor and a destructor: when there's a destructor to take care of closing the archive, the null check becomes actually redundant and *then* rpmcpioFree() would be just "delete cpio; return NULL".
Getting clang-tidy to produce meaningful output on rpm is a worthy goal though, and something we could include in CI. So if it's something you want to pursue, I'd suggest approaching it by adding a make target to do so, and add whatever switches and/or configuration to get a clean output, and then proceed to eliminate disablers where possible. That way it becomes more apparent what things are related to exactly, and we could add it to CI as soon as there's a configuration in which it runs cleanly. Reducing the amount of warning disablers can then proceed on its own schedule as time permits.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3951#issuecomment-3310800851
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3951/c3310800851 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250918/9dfa0de9/attachment-0001.htm>
More information about the Rpm-maint
mailing list