Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: static_cast to fix sign conversion warning #1715

Merged

Conversation

evan-goode
Copy link
Member

Without this patch, the i686 build fails due to -Werror and a sign conversion warning, introduced in #1703.

I only noticed the error after making an upstream release and trying to build DNF 5.2.6.1 in Koji. It might be good to have builds for non-x86_64 architectures tested in our upstream CI so we can catch these issues sooner.

@jrohel jrohel self-assigned this Sep 20, 2024
@jrohel
Copy link
Contributor

jrohel commented Sep 20, 2024

Without this patch, the i686 build fails due to -Werror and a sign conversion warning

On x86_64, std::vector<some_type>::difference_type is a 64 bit signed type. Thus it can hold a larger number than unsigned int, a 32 bit unsigned type.
But, on i686, std::vector<some_type>::difference_type is a 32 bit signed type. So the compiler correctly warned when adding unsigned int - a 32 bit unsigned type.

It might be good to have builds for non-x86_64 architectures tested in our upstream CI.

Yes, good idea. Especially testing a 32 bit build.

We could also test builds for big-endian architecture. To catch endian related bugs. Fedora supports s390x - big-endian architecture.

@jrohel
Copy link
Contributor

jrohel commented Sep 20, 2024

Thanks for the fix.

@jrohel jrohel added this pull request to the merge queue Sep 20, 2024
Merged via the queue into rpm-software-management:main with commit f364dad Sep 20, 2024
16 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants