all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: "Herring, Davis" <herring@lanl.gov>, Mathieu Lirzin <mthl@gnu.org>
Cc: Wilfred Hughes <me@wilfred.me.uk>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Using " rather than < for header files in Emacs
Date: Sat, 5 Mar 2016 09:39:01 -0800	[thread overview]
Message-ID: <56DB19B5.7040906@cs.ucla.edu> (raw)
In-Reply-To: <B393F5AD12955C48A84FFB08032CD04F6C47D7A9@ECS-EXG-P-MB01.win.lanl.gov>

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?

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



  reply	other threads:[~2016-03-05 17:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 22:30 Using " rather than < for header files in Emacs Wilfred Hughes
2016-03-02 23:10 ` Paul Eggert
2016-03-02 23:21   ` Herring, Davis
2016-03-05 13:09     ` Mathieu Lirzin
2016-03-05 13:57       ` Herring, Davis
2016-03-05 17:39         ` Paul Eggert [this message]
2016-03-08 15:51           ` Mathieu Lirzin
2016-03-09  8:19             ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56DB19B5.7040906@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=herring@lanl.gov \
    --cc=me@wilfred.me.uk \
    --cc=mthl@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.