types of variables and their sizes for WinAVR compiler?

Hi there,

I think the sizes of int, float, unsigned integer etc. depends on compilers. I have the WinAVR (20080610 June 10, 2008) compiler. But I could not find any manual for it.

Can somebody provide me with the list of types of variables and their sizes for this compiler? I would appreciate that. Thanks

Regards

It might not have changed from an earlier version

you may refer an old manual though

Instead of listing them all out, determine for yourself

int sz = sizeof(int)

int usz = sizeof(unsigned int)

But I suggest if you’re writing code which depends on certain sizes to use the stdint.h header and the explicit size types:

uint8_t, uint16_t, uint32_t, int16_t, etc etc

theatrus:
Instead of listing them all out, determine for yourself

int sz = sizeof(int)

int usz = sizeof(unsigned int)

But I suggest if you’re writing code which depends on certain sizes to use the stdint.h header and the explicit size types:

uint8_t, uint16_t, uint32_t, int16_t, etc etc

Are these specific to WinAVR compiler? For the sake of portability, I would like to stick to the standard data types as they are written like int, unsigned int etc.

Thanks

.

stdint.h is part of C99. All GCC releases support a useful subset of C99, and avr-libc does contain a stdint.h implementation.

http://en.wikipedia.org/wiki/Stdint.h

If you choose to only use standard types, you can’t make exact guarantees of their bit size. Some systems even have sizeof(char) == 2, which can be a mind bender.