-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/alg-yescrypt-platform.c: Fix -Werror=sign-conversion.
In 894aee7 we introduced some changes, which show is this error when building with GCC v12.2.1.
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
05e5705
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@solardiz FYI.
05e5705
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @besser82. This is nasty stuff (
mmap
is specified to accept anint
for flags, but applying~
to a signed type is... not ideal, and can lead to other warnings), and one more example that makes me question the usefulness of that warning. I actually did test theMAP_HUGE_2MB
fix on a gcc 12 system, but didn't have that warning enabled - if I enable it, there are many more to fix. I don't know if all of those are already fixed in libxcrypt - I know one is (#161), which I was about to fix as well but didn't yet because there are so many more anyway.I guess instead of your:
I'd try something like:
or even:
Doesn't look pretty. :-(
or maybe use
unsigned int flags
and then cast to(int)
on the call tommap
.05e5705
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're welcome! I've changed it as recommended in 53cff4b.