[Top][All Lists]

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

Re: [avr-gcc-list] Makefile Procyon AVRlib vs AVR-libc and ANSI C

From: Dave Hylands
Subject: Re: [avr-gcc-list] Makefile Procyon AVRlib vs AVR-libc and ANSI C
Date: Wed, 5 Oct 2005 17:03:41 -0700

Hi Patrick (sent to the whole list this time - Doh),

> The first example is what I recall reading in K&R.
> The second method is confusing, and neither method appears to be declaring 
> the same!
> eg.. unsigned short == u16 == uint16t ?
> thanks for helping here...and putting up with what is probably a very basic 
> issue with GCC.

I believe that C99 introduced the uint8_t, uint16_t types as part of
the runtime library. This means that you can rely on them being
defined and you don't need to define them yourself.

So, code written prior to C99 tended to create their own definitions.
People who are aware of the new types, often prefer to use them
(myself included), since they'll be available on all compilers that
support C99 (I believe by including the <inttypes.h> header file).

I use a type like uint16_t when I know I specifically need a 16 bit
value (which is often the case when dealing with hardware registers).
If I don't care, then I'll use one of the more generic int, or
unsigned types.

Dave Hylands
Vancouver, BC, Canada

reply via email to

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