Cast MS_RDONLY to uintptr_t to fix build error on Fedora 43 (Glibc 2.42) due to unsigned enum - #246
Merged
Merged
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Collaborator
|
Great, thank you! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a build failure on Fedora 43 (and likely on other systems with Glibc 2.42+) where
sys/mount.henum is unsigned. In Glibc 2.42,MS_NOUSERwas updated to1U << 31from1 << 31to fix integer overflow warnings (Bug 32708, commit: 3263675250cbcbbcc76ede4f7c660418bd345a11). This change forces the entire sys/mount.h enum (which includes MS_RDONLY) to be unsigned, which causes the build to fail inmnt.cc.Build errors:
Casting
MS_RDONLYtouintptr_tfixes this issue by ensuring type compatibility,Tested on Fedora 43 (Glibc 2.42, Unsigned enum) and on Debian 13 (Glibc 2.41, Signed enum). Tested also on Arch Linux with Glibc 2.42 to confirm its not Fedora only issue.
Glibc 2.42 release notes: https://inbox.sourceware.org/libc-announce/5906001.DvuYhMxLoT@pinacolada/T/