svn commit: r293775 - head/sys/boot/uboot/lib

Ian Lepore ian at freebsd.org
Wed Jan 13 01:17:01 UTC 2016


On Wed, 2016-01-13 at 01:03 +0000, Brooks Davis wrote:
> On Wed, Jan 13, 2016 at 12:41:41AM +0000, Steven Hartland wrote:
> > Was this meant to be a full revert as you now have:
> > 
> > subldr = rounddown2((uintptr_t)_start, KERN_ALIGN);
> > 
> > vs the original:
> > 
> > subldr = rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN);
> > 
> > i.e. missing the final conversion to uint64_t?
> 
> The cast through uint64_t isn't allowed by the standard if you want
> the
> result to be a function pointer.  The implementation of rounddown2()
> should work fine on an uintptr_t even for fairly radical
> implementations.
> 
> -- Brooks

_start is a function pointer, but subldr is uint64_t.  The cast isn't
needed inside the macro invocation because the round-down calculation
can't create a larger result than the size of the types involved.

-- Ian


More information about the svn-src-head mailing list