Re: [patch] Input cleanups for 2.5.29 [2/2]

Brad Hards (bhards@bigpond.net.au)
Wed, 31 Jul 2002 07:38:00 +1000


On Wed, 31 Jul 2002 07:20, Linus Torvalds wrote:
> On Tue, 30 Jul 2002, Greg KH wrote:
> > On Tue, Jul 30, 2002 at 03:23:42PM +0200, Vojtech Pavlik wrote:
> > > -#include <asm/types.h>
> > > +#include <stdint.h>
> >
> > Why? I thought we were not including any glibc (or any other libc)
> > header files when building the kernel?
>
> Indeed. This is unacceptable.
Its a minor thinko - <linux/types.h> is the right definition.

> Especially as the standard types are total crap, and the u8 etc are a lot
> more readable. People should realize:
>
> - the "int" is superfluous. Of _course_ it's an integer. If it was a
> floating point number, it would be fp16/fp32/fp64/fp80/whatever.
> - the "_t" is there only for namespace collisions, sane people can chose
> to ignore it.
Sure, it is a convention that only a committee could love.
But it is at least widely understood by userspace programmers.

> What do you have left after you have removed the crap? Yup. u8, u16, etc.
Fine for internal to the kernel. Absolutely. Required knowledge to play
with the kernel.

> And if you want to share with user space, there's the long-accepted
> namespace collision avoidance of prepending two underscores.
This is where we disagree. __u8 requires the (userspace) programmer
to go off, find out that __u8 is really some wierd Linux-ism that he
can safely map to uint8_t, to use with the rest of the *standard* library
routines.

> Fix it, Vojtech.
Please don't be hasty.

This isn't about the kernel representation. It is about making ABIs as
easy as possible for userspace programmers to use. If there is an
ugly but standard way, and an almost-as-ugly and non-standard way,
I don't think that the standard way is too much to ask.

Brad

-- 
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/