home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:16739 gnu.gcc.help:2556
- Newsgroups: comp.lang.c,gnu.gcc.help
- Path: sparky!uunet!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!newsaintmail
- From: sim@mdtf14.fnal.gov (Jim Sim)
- Subject: Include file directory search path
- Message-ID: <SIM.92Nov18151448@mdtf14.fnal.gov>
- Sender: daemon@linac.fnal.gov (The Background Man)
- Nntp-Posting-Host: mdtf14.fnal.gov
- Organization: Fermilab, Batavia, IL
- Distribution: usa
- Date: Wed, 18 Nov 1992 21:14:48 GMT
- Lines: 50
-
- Is there a way to force the C preprocessor to use the same search path to
- locate nested include files (files included by another include file)
- that it uses to locate non-nested include files. My motivation for doing
- this is to allow developers to make "test" changes to nested include files
- that don't affect "official" versions of those include files. Consider the
- following:
-
- main.c:
-
- #include "non-nested.h"
-
- main()
- {
- /* Statements that use variables / macros declared / defined in
- nested.h. */
- }
-
- non-nested.h:
-
- #include "nested.h"
-
- nested.h:
-
- variables/macros
-
- cc -c main.c -I/usr/local/official main.c
-
- or
-
- gcc -c main.c -I/usr/local/official main.c
-
- If /usr/local/official contains both nested.h and non-nested.h files, while
- the "test" directory contains only nested.h, the version of nested.h from the
- /usr/local/official directory is used by the preprocessor. I would prefer it
- to use /usr/local/official/non-nested.h and the version of nested.h
- in the "test" directory.
-
- There is no problem if the "test" directory contains non-nested.h in addition
- to nested.h. In this case, the preprocessor uses both nested.h and
- non-nested.h from the "test" directory. However, I would prefer not to
- be required to copy /usr/local/official/non-nested.h to the "test" directory
- when I am not making changes to that file.
-
- There is also no problem if I delete /usr/local/official/nested.h. In this
- case, because nested.h did not exist in the /usr/local/official directory,
- the preprocessor looked for it in the "test" directory. However, since
- my make procedures have dependencies that force re-compilation of "official"
- code (after SCCS extraction of /usr/local/official/nested.h), this results in
- unnecessary recompilations.
-
-