rpm-software-management / dnf5

Next-generation RPM package management system
Other
238 stars 79 forks source link

Fix: libdnf5-cli: TransactionSummary counters data type #1701

Closed jrohel closed 2 weeks ago

jrohel commented 2 weeks ago

Fixes error: implicit conversion changes signedness: 'const int' to 'unsigned long' [-Werror,-Wsign-conversion]

The bug was caused by commit https://github.com/rpm-software-management/dnf5/pull/1696

ppisar commented 2 weeks ago

Sorry. I did not notice that ngettext() expects an unsigned long int as a counter. Shouldn't we add -Wsign-conversion to CXXFLAGS so that GCC catches it too?

m-blaha commented 2 weeks ago

Sorry. I did not notice that ngettext() expects an unsigned long int as a counter. Shouldn't we add -Wsign-conversion to CXXFLAGS so that GCC catches it too?

Good idea. I tried, but I must have done it incorrectly, because even with -Wsign-conversion the gcc did not catch the error.

jrohel commented 2 weeks ago

We have Package Build / CCache Build (clang), which uses clang for compilation. Unfortunately wrong. As you can see with this PR, the build fails because it uses source code without this PR. In other words, it doesn't test this PR but the older code without it. So if there's a bug in the PR, it will show up later in some other PRs. The cache is working strangely.