AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:
CFG:
PT:0
S:andy.sharp@lsi.com
RQ:
SSV:mhbs.lsil.com
NSV:
SSH:
R:<Larry.Scheer@lsi.com>
MAID:2
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/LSI/INBOX	0	DEC609CD0E54B2448DAF023C89AE9755E250CEC6@cosmail02.lsi.com
X-Sylpheed-End-Special-Headers: 1
Date: Thu, 10 Sep 2009 16:12:15 -0700
From: Andrew Sharp <andy.sharp@lsi.com>
To: "Scheer, Larry" <Larry.Scheer@lsi.com>
Subject: Re: Changing the way header files are included in tuxrc/tuxstor
Message-ID: <20090910161215.65fef198@ripper.onstor.net>
In-Reply-To: <DEC609CD0E54B2448DAF023C89AE9755E250CEC6@cosmail02.lsi.com>
References: <DEC609CD0E54B2448DAF023C89AE9755E250CEC6@cosmail02.lsi.com>
Organization: LSI
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Thu, 10 Sep 2009 16:52:30 -0600 "Scheer, Larry"
<Larry.Scheer@lsi.com> wrote:

> Andy,
>    I was reviewing some of the changes made to the nfx-tree files in
> the tuxrx branch. I am seeing things like:
> 
> #include <sm-rmc/rmc_eee.h>
> versus:
> #include "../sm-rmc/rmc_eee.h"
> 
> The ../ business doesn't matter but  why the switch to angle brackets
> [<>] versus quotes[""]? I know you probably know this, but the angle
> brackets mean this is a system header file and the compiler
> automatically looks into its sysinclude directories to find this
> file.  Are you planning to move all the header files you are
> including with angle brackets to the system include  directory some
> day? Why did you make this change? What do I need to know about
> reasoning behind this change?

The angle brackets mean look in the include search path, which is
augmentable with the -I compiler option, amongst other methods.  The
double quotes means search in the directory where the original
including C file is located.  A most awkward and incorrect use of double
quotes in all these files.  nfx-tree/code is obviously part of the
include search path, as is Includes, so it should be -- and always
should have been -- handled with angle brackets instead of
the ../nonsense.  Also bear in mind that when building kernel code, or
the EEE images, the include search path is only what you define it to
be, there are no default directories in the include search path.  In
other words, /usr/include is never searched, nor are any header files
ever used from there.

This gives the programmer the ability to include standard header files
no matter where you are in the code heirarchy without mistake or
error.  It also explicity says to the maintainer where that header file
is located, regardless of what file is including it, and where in the
code heirarchy that file lives.  These reasons are especially true for
header files that include other header files.  They will always get the
right header file, regardless of where the original including C file was
located.  It's also a lot less typing.  Code shrinkage.  Storage
savings.
