Afficher un message
Vieux 19/10/2007, 07h11   #7
Keith Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C both slow and memory-hungry for embedded systems?

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"
  Réponse avec citation
 
Page generated in 0,05817 seconds with 9 queries