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: Theodore A. Roth
Subject: Re: [avr-gcc-list] Proper form for #include directives
Date: Wed, 21 Aug 2002 17:10:19 -0700 (PDT)

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



reply via email to

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