[Rpm-maint] [rpm-software-management/rpm] Get rid of -Wno-sign-compare (Issue #3226)

Panu Matilainen notifications at github.com
Thu Jan 16 14:03:13 UTC 2025


Got some spare cycles just now and took a quick look at this:

> $ for d in rpmio lib sign build tools; do echo -n "${d}:"; grep /${d}/ /tmp/wsign-compare.txt|wc -l; done
rpmio:19
lib:207
sign:8
build:40
tools:8

It's well worth doing removing -Wsign-compare one directory at a time, starting with the lower hanging fruit. Enabling the warnings one directory at a time ensures we don't introduce new signed comparisons in those areas at least.

Some of it is pretty tame, like about half of the build/ warnings come from those repeated `for (pe = p; (pe-p) < strlen(name); pe++)` lines where we know pe is always >= p so the comparison is always between unsigned values, and this can be handled centrally with a macro or whatever. And then silly stuff like using an ranged for or iterator for walking over an STL container instead of the C world leftovers.

The hairiest and scariest stuff lives in lib/ and that's probably just best left out of scope for 6.0 except maybe for individual trivial bits.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3226#issuecomment-2595780289
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/3226/2595780289 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250116/e9a603c5/attachment-0001.htm>


More information about the Rpm-maint mailing list