On Sun, 14 Apr 2013, Theo de Raadt wrote:
That wasn't clear from Miod's response. So the policy is to assume
that char/short/int/long long are 8/16/32/64 bits and that intptr_t
is long?
We only run on C8S16I32L32P32 and C8S16I32L64P64 architectures. Short
names ILP32 and I32LP64. The addition of any other sizing would
require us to fix thousands of subtle bugs, and crank the ABI on every
architecture.
Should that be added to style(9), then?
I assume that the lack of a response means yes.
Perhaps. Thing is, we don't want people to worsen the current
situation for decades down the line in case someone tries to create
a 'popular' architecture with I64.
Or LL128 ...
But if such architectures come around, all kinds of things will need to be
changed. This should not prevent anyone from documenting the current best
practices.
Since the kernel's printf does not support %td for ptrdiff_t, I have
used %ld instead. %zd would also work. Is there a preferred way?
Or try to add %td support to kernel printf?
That would also require gcc to be taught that %td is now allowed. I don't
know how difficult that is, but I will take a look when I have some time.