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

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

RE: [avr-gcc-list] Proper form for #include directives


From: Dean Ferreyra
Subject: RE: [avr-gcc-list] Proper form for #include directives
Date: Wed, 21 Aug 2002 18:59:33 -0700

Thanks for your answer, Ted.

I hadn't seen the avr-libc documentation
(http://www.freesoftware.fsf.org/avr-libc/).  (Documentation!)  Had I seen
it I would have come to the correct conclusion.  (The documentation has some
examples with lines like #include <io.h>, though.)

I had looked at Rich Neswold's related document
(http://www.enteract.com/~rneswold/avr/), but it uses the #include <io.h>
style throughout, so I couldn't tell if that was left over from the original
way or truly the new way.

Dean

-----Original Message-----
From: address@hidden [mailto:address@hidden
Behalf Of Theodore A. Roth
Sent: Wednesday, August 21, 2002 5:10 PM
To: Dean Ferreyra
Cc: AVR List
Subject: Re: [avr-gcc-list] Proper form for #include directives




On Wed, 21 Aug 2002, Dean Ferreyra wrote:

:) Hello,
:)
:) I'm back using avr-gcc again after a year and a half.  (I did CVS pulls
of
:) binutils, gcc, avr-libc, and uisp, and built under Cygwin.)

Welcome back.

:) I can imagine two ways to think about this:
:)
:) 1.  The include/avr/interrupt.h file is an implementation detail,
therefore
:) still prefer #include <interrupt.h> in new code.
:)
:) 2.  The include/interrupt.h file is there for backward compatibility,
:) therefore prefer #include <avr/interrupt.h> in new code.

2 is correct, I think.

Any header that is avr specific should be included from the avr dir as
such:

  #include <avr/io.h>
  #include <avr/interrupt.h>

But any file that is part of some standard (ISO C for example), should be
included without the avr dir, such as:

  #include <string.h>
  #include <math.h>
  #include <inttypes.h>

If my reasoning is correct, then I should add this as a note into the
avr-libc documentation.

Ted Roth

avr-gcc-list at http://avr1.org

avr-gcc-list at http://avr1.org



reply via email to

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