[En-Nut-Discussion] Nut/OS finally moving to C99 types

Nathan Moore nategoose at gmail.com
Thu Apr 17 15:38:27 CEST 2008


>
>
> > > Are you switching return types for event functions to use int_fast8_t?
> >
> > If I remember correctly, the AVR compiler generates the same code, no
> > matter wether an 8 or 16 bit value is returned.
> >
> > Please correct me if I'm wrong.
> >
> > I know it returns the same sized data, but I believe that the comparison
> will only be with one of the returned bytes.
> I'll need to check this, though.
>

It actually only writes one byte and compares one byte for both the caller
and callee doing a compare with the return value
with gcc version 4.3.  The compiler considers the upper byte to be clobbered
(and a bunch of other bytes), but you can sav e
a comparison at every caller and those add up.

Nathan



More information about the En-Nut-Discussion mailing list