Observations from an old timer playing with 64 bit numbers...

Luigi Rizzo rizzo at iet.unipi.it
Wed Jun 23 17:02:02 UTC 2010


On Wed, Jun 23, 2010 at 09:50:26AM -0700, Randall Stewart wrote:
...
> >>strong objection!
> >>We should instead use names with exact sizes (16,32,64).
> 
> So please tell me why you object so strongly? We have the 16/32/64 bit  
> names which
> are nice but are not expected so folks seem to not use them. I have

people's ignorance is not an excuse for not doing things right.
We'd still be using BYTE, WORD and DWORD otherwise.

I think there is no doubt that we should use the 16/32/64 bit names
if we could start from scratch, and the only reason for not doing
so is avoiding gratuitous changes to existing/stable code.

The case of *to*ll does not apply, in that there is no actual legacy
to adapt to. And btw there is tons of places which use the 16/32/64 bit
names in the filesystem, usb and generic device drivers. In fact,
many more than ntohl/htonl

	> grep -r be32 ~/FreeBSD/head/sys/ | grep -v .svn | wc
	    1438    6397  145174
	> grep -r le32 ~/FreeBSD/head/sys/ | grep -v .svn | wc
	    2203   10269  210989
	> grep -r ntohl ~/FreeBSD/head/sys/ | grep -v .svn | wc
	     854    4009   84855
	> grep -r htonl ~/FreeBSD/head/sys/ | grep -v .svn | wc
	     738    3604   72970

cheers
luigi


More information about the freebsd-net mailing list