avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] AVR-GCC variable size


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] AVR-GCC variable size
Date: Mon, 29 Jan 2007 22:15:26 +0100
User-agent: Mutt/1.5.11

Privet (i dobroje utro :),

> Hi what is the uint_fast8_t ? What is the difference from regular
> uint8_t?  What gcc version is it supported from?

While uint8_t requests an unsigned integer type that will *exactly*
have 8 bits (so it is guaranteed to roll over from 255 to 0),
uint_least8_t will request an unsigned integer type that has at least
8 bits (but could have more, e. g. if the machine can only support
32-bit integers at all), and uint_fast8_t requests an unsigned integer
type that has the fastest processing for (at least) 8 bits of data.

For the AVR, all three are the same.  However, most if not all RISC
CPUs suffer from additional penalties when handling less than "natural
sized" objects, so a 32-bit RISC CPU is usually fastest when dealing
with 32-bit integers.  In that case, uint_fast8_t will certainly be
rather a 32-bit integer type, while uint8_t can still be implemented
on that machine (but is less effective).  Other machines (like certain
DSPs) can *only* handle 32-bit integer data types, and on these
machines, requesting an uint8_t will simply cause a compile error.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]