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

Avoid a gcc -Wint-to-pointer-cast warning #16203

Merged
merged 1 commit into from
May 25, 2024

Conversation

brooksdavis
Copy link
Contributor

On 32-bit platforms long long is generally 64-bits. Sufficiently modern versions of gcc (13 in my testing) complains when casting a pointer to an integer of a different width so cast to uintptr_t first to avoid the warning.

Fixes: c183d16 Parallel pool import

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

On 32-bit platforms long long is generally 64-bits.  Sufficiently modern
versions of gcc (13 in my testing) complains when casting a pointer to
an integer of a different width so cast to uintptr_t first to avoid the
warning.

Fixes: c183d16 Parallel pool import
Signed-off-by: Brooks Davis <brooks.davis@sri.com>
freebsd-git pushed a commit to freebsd/freebsd-src that referenced this pull request May 17, 2024
On 32-bit platforms long long is generally 64-bits.  Sufficiently modern
versions of gcc (13 in my testing) complains when casting a pointer to
an integer of a different width so cast to uintptr_t first to avoid the
warning.

Fix i386 gcc builds while we wait for this to be merged to OpenZFS.

Sponsored by:	DARPA, AFRL
Pull Request:	openzfs/zfs#16203
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label May 22, 2024
@behlendorf behlendorf merged commit 7572e8c into openzfs:master May 25, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants