On 24/02/2021 11:07, Ian Jackson wrote: > Jan Beulich writes ("Re: [PATCH 2/2] hvmloader: do not include system headers > for type declarations"): >> Like the hypervisor, we should prefer using __SIZE_TYPE__ >> when available. > I disagree.
size_t is obnoxious in the C spec. It might not be the largest native word size on the processor, and in some 64bit environments, it really is 32 bits. It cannot be correctly derived from a standard type, and must come from the compiler, because it critical that it matches what the compiler generates for the sizeof operator. Posix being fairly sane prohibits environments where the maximum object size is smaller than the address size, which is why aliasing it to unsigned long works in the common case. ~Andrew