Date: Wed, 27 May 2009 22:08:05 +0200 From: Roland Smith <rsmith@xs4all.nl> To: FreeBSD-Questions@freebsd.org Subject: Re: FreeBSD & Software RAID Message-ID: <20090527200805.GA20419@slackbox.xs4all.nl> In-Reply-To: <alpine.BSF.2.00.0905272123120.54285@wojtek.tensor.gdynia.pl> References: <4A1AA3DC.5020300@network-i.net> <200905271048.27837.kirk@strauser.com> <alpine.BSF.2.00.0905271832320.53013@wojtek.tensor.gdynia.pl> <200905271152.34237.kirk@strauser.com> <20090527190230.GB9937@Grumpy.DynDNS.org> <alpine.BSF.2.00.0905272123120.54285@wojtek.tensor.gdynia.pl>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] 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, Not completely, at least as far as C is concerned. I'd say that char and long are portable, but not short and int. According to K&R (and I don't think this has changed in later standards), a char is defined as one byte. Short, int and long can vary but short and int must be at least 16 bits, and a long must be at least 32 bits. Additionally a short may not be longer than an int which may not be longer than a long. But the size of an int depends on hardware platform and compiler data model. Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkodnaUACgkQEnfvsMMhpyURWgCdFilgOTHdQFtX9nVOQfVTeKYF AAEAn0ENltNQIGFdAUUjzyo7UqgZJmly =e93a -----END PGP SIGNATURE-----help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090527200805.GA20419>
