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

Re: C source



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Jul 15, 2016 at 02:59:12PM +0200, Andre Majorel wrote:
> 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).

Yep, you are right.

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

ack.

> 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.

again, ack.

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAleI5GgACgkQBcgs9XrR2kZwIgCfWCXUwPjnXNY7DrHp+Nh2RA1j
UWwAnA4yi7K9rj8qZZf1EmMOyjuV4WaF
=y7ea
-----END PGP SIGNATURE-----


Reply to: