On Wed, May 27, 2009 at 09:24:17PM +0200, Wojciech Puchar wrote:
> >I haven't looked at the ZFS code but this sort of thing is exactly why
> >all code I write uses int8_t, int16_t, int32_t, uint8_t, ... even when
> >the first thing I have to do with a new compiler is to work out the
> >proper typedefs to create them.
> int, short and char are portable, only other things must be defined this 
> way.

No, they are not portable. "int" is 16 bits on many systems I work with.
char is sometimes signed, sometimes not. uint8_t is never signed and
always unambiguous.

> int8_t int16_t is just unneeded work. anyway - it's just defines, having 
> no effect on compiled code and it's performance.

No, they are not "just defines", I said "typedef". Typedef is subject to
stricter checking by the compiler.

Packing and alignment in structs is a big portability problem.

David Kelly N4HHE, dke...@hiwaay.net
Whom computers would destroy, they must first drive mad.
freebsd-questions@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to