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

Re: C source



On 2016-07-15 11:54 +0200, tomas@tuxteam.de wrote:

> As your includes are written above, the C compiler would look
> for a file md5.h in the current compilation directory: most
> probably there isn't one, since whatever package you installed
> will put it in a standard system location, typically under
> /usr/include.

On 2016-07-15 12:56 +0300, Reco wrote:

> #include with encased in 'less' and 'more' characters instructs
> preprocessor to search header files system-wide. A search path can be
> modified with -L flag.
> 
> #include with quotes instructs preprocessor to search a header file in
> the current directory.
> 
> So probably you meant to write this:
> 
> #include <md5.h>

tomas@tuxteam.de & Reco's statements could give the impression
that #include <*> searches the standard system include
directories (/usr/include et al.) while #include "*" searches
the current working directory. That's misleading in that
#include "*" also searches the directories that #include <*>
does.

The standard explicitly says so (see [#3] in 6.10.2 in n869, for
instance).

So trying to make cpp find a header by replacing the "" by <> is
not likely to work.

The rule of thumb of using "" for application headers and <> for
system headers is valid. But a more accurate way to summarise
the difference would be that #include <> only looks at the
system directories.

-- 
André Majorel <http://www.teaser.fr/~amajorel/>
lists.debian.org, a spammer's favourite.


Reply to: