emacs-devel
[Top][All Lists]
Advanced

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

Re: Using " rather than < for header files in Emacs


From: Mathieu Lirzin
Subject: Re: Using " rather than < for header files in Emacs
Date: Tue, 08 Mar 2016 16:51:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Paul Eggert <address@hidden> writes:

> Herring, Davis wrote:
>> It is defined by C (don't know as of which version off hand) that 
>> #include"x" can find what #include<x> finds (but may find something else 
>> first).
>
> Yes, a portable program can't assume that "..." will find files that
> <...> won't. In some C compilers, "..." looks in the working directory
> that the compiler is run in; in POSIX-compatible compilers (including
> GCC) "..." will first look in the directory containing the source file
> that has the "..."; in other C compilers (including Microsoft) "..."
> will also search in the directories of currently opened include files;
> and I assume there are other possibilities.

> In theory, the "..." form could lead to including the wrong file. In
> practice, the way Emacs does it is harmless, but why add risk by using
> "..." more often?

Could you give a concrete example of a possible include problem using
"..."?  It would help me understand the issue.

> (There was a reason in GCC before 3.0 to prefer angle brackets or
> double quotes, depending on whether you wanted -MM to generate
> dependency information, but that reason is obsolescent now.)

I didn't know about that.  Thanks for sharing your knowledge.  :)

-- 
Mathieu Lirzin



reply via email to

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