Page MenuHomeFreeBSD

__builtin_align_down: Cast value to __uintptr_t in the fallback
ClosedPublic

Authored by jhb on Sat, Feb 7, 3:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 2, 9:41 AM
Unknown Object (File)
Sun, Mar 1, 7:16 AM
Unknown Object (File)
Thu, Feb 19, 9:33 PM
Unknown Object (File)
Thu, Feb 19, 8:05 AM
Unknown Object (File)
Thu, Feb 19, 3:02 AM
Unknown Object (File)
Wed, Feb 18, 6:34 PM
Unknown Object (File)
Mon, Feb 16, 9:23 PM
Unknown Object (File)
Mon, Feb 16, 8:00 PM
Subscribers

Details

Summary

This matches the behavior of the fallbacks for builtin_align_up
and
builtin_is_aligned.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I worry that this was intentionally left out to avoid breaking there use of rounddown() on integer types larger than uintptr_t? (E.g. vm_paddr_t on i386)

If that is really a worry, maybe we use _Generic (including the fallback for pre-C11) that maps pointer types to versions that use uintptr_t and otherwise doesn't use the cast?

This revision is now accepted and ready to land.Tue, Feb 17, 9:10 PM

Almost certainly an accidental omission