svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux

Bruce Evans brde at optusnet.com.au
Tue Nov 10 18:23:14 UTC 2015


On Tue, 10 Nov 2015, Justin Hibbits wrote:

> On Tue, Nov 10, 2015 at 9:42 AM, Conrad Meyer <cem at freebsd.org> wrote:
>> ...
>> Given that intptr_t exists in our implementation and is a signed
>> integer type, I see no reason why intmax_t could possibly not
>> represent any such value.  Same argument for the unsigned variants.
>
> I may be wrong on this, but I *think* uintptr_t/intptr_t are required
> to be *precisely* the same size as a pointer, which explains why you
> can't cast directly from uintmax_t on 32-bit architectures.

Good compilers use the size for a simple portability check.  They
should also complain if the types are different but have the same size,
as is done for int vs long format mismatches on i386.

Bruce


More information about the svn-src-all mailing list