On Sun, Apr 21, 2013 at 12:15 PM, Stefan Fritsch <[email protected]> wrote: > On Sunday 21 April 2013, Mark Kettenis wrote: ... >> You can't put ptrdiff_t in <sys/types.h> either. > > Why not? POSIX only speaks about "at least the following types" in > sys/types.h, so there is no reason why it may not define more types.
Well, it can define others as long as it stays within the namespace restrictions. It turns out that ptrdiff_t *is* within the permitted namespace (because it ends with "_t"). However, we have generally tried to avoid defining more than is required to be present so that devs don't accidentally rely on a non-portable assumption like that. Maybe this should be handled the bool bits in <sys/types.h>, wrapping them in #ifdef _KERNEL ? Alternatively, if subr_prf.c is the only kernel file which will actually need the ptrdiff_t type then perhaps it should just use __ptrdiff_t directly. Philip
