CBFalconer <cbfalconer@yahoo.com> writes:
> Martin Wells wrote:
> ... snip ...
>>
>> I think a fair few embedded programmers are starting to use things
>> like int_fastest_at_least_8 which are defined in C99.
>>
>> To be a fully-portable programmer both for PC's and for embedded
>> systems, should we start using these <stdint.h> types?
>
> No. They (and we) should avoid them. They are not portable,
> because they are not universally available (as are byte, int, long)
> and are also a C99 construct. Note that even a C99 system will not
> necessarily make those types available, because they are hardware
> dependant.
As Ben Pfaff points out, the 8-, 16-, 32-, and 64-bit "least" and
"fast" types are mandatory; only the exact-width types are optional.
And even though they weren't standardized until C99, they're not hard
to define in C90 (except perhaps for the 64-bit types). See for
example Doug Gywn's "q8" package (though I suppose the "fast" types
can't reliably be defined automatically).
--
Keith Thompson (The_Other_Keith)
kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"