On 12.01.2023 15:22, Andrew Cooper wrote: > On 12/01/2023 2:01 pm, Jan Beulich wrote: >> size_t, ssize_t, and ptrdiff_t are all expected to be uniformly defined >> on any ports Xen might gain. In particular I hope new ports can rely on >> __SIZE_TYPE__ and __PTRDIFF_TYPE__ being made available by the compiler. >> >> Signed-off-by: Jan Beulich <[email protected]> > > Acked-by: Andrew Cooper <[email protected]>
Thanks. >> --- >> This is just to start with some hopefully uncontroversial low hanging fruit. > > However, I'd advocate going one step further and making real a > xen/stddef.h header to match our existing stdboot and stdarg, now that > we have fully divorced ourselves from the compiler-provided freestanding > headers. Hmm, to be honest I'm not convinced. It'll be interesting to see what other maintainers think about such further moving away from Linux'es basic model. > This way, the type are declared in the usual place in a C environment. > > I was then also going to use this approach to start breaking up > xen/lib.h which is a dumping ground of far too much stuff. In > particular, when we have a stddef.h, I think it is entirely reasonable > to move things like ARRAY_SIZE/count_args()/etc into it, because they > are entirely standard in the Xen codebase. Yet these aren't what people would expect to live there. If we introduce further std*.h, then I think these would better strictly conform to what the C standard expects to be put there. Jan
