stdint.h INT_LEAST defines

Eric Blake ebb9@byu.net
Sun Mar 9 21:56:00 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Howland Craig D (Craig) on 3/7/2008 4:13 PM:
| So the basic question that this email is raising is:  are the INT_LEAST
| set of defines supposed to reflect the actual range that the respective
| int_least types can hold, or should they only reflect the range that
| they
| are required to hold?

POSIX requires the existence an 8-bit type (ie. char), and requires that
int_least<N>_t be the smallest type that has at least <N> bits with no
smaller type having enough bits.  Therefore, int_least8_t is required to
be exactly 8 bits, so your complaint is not worth worrying about.

Now, for int_least16_t, we may have something worth discussing - it is
theoretically conceivable to have a platform with only 1-byte and 4-byte
(but no 2-byte) types, meaning int_least16_t could be a 32-bit type.  But
since newlib doesn't target such a (theoretical) platform, this
conversation is still not worth worrying about.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH0gxy84KuGfSFAYARAubCAJ4hQ4325IWskIHUnqCYB9krklHiCQCeJgKQ
ZJjBZpPrYi3uYSEYDe9od/E=
=D/MI
-----END PGP SIGNATURE-----



More information about the Newlib mailing list