Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2016 18:16:58 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Brooks Davis <brooks@freebsd.org>, Steven Hartland <steven.hartland@multiplay.co.uk>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r293775 - head/sys/boot/uboot/lib
Message-ID:  <1452647818.46848.46.camel@freebsd.org>
In-Reply-To: <20160113010348.GF79262@spindle.one-eyed-alien.net>
References:  <201601121631.u0CGV7v6074494@repo.freebsd.org> <569582F6.4060108@multiplay.co.uk> <1452644710.46848.31.camel@freebsd.org> <56959D45.7070204@multiplay.co.uk> <20160113010348.GF79262@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1452647818.46848.46.camel>