all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathieu Lirzin <mthl@gnu.org>
To: "Herring\, Davis" <herring@lanl.gov>
Cc: Paul Eggert <eggert@cs.ucla.edu>,
	emacs-devel <emacs-devel@gnu.org>,
	Wilfred Hughes <me@wilfred.me.uk>
Subject: Re: Using " rather than < for header files in Emacs
Date: Sat, 05 Mar 2016 14:09:35 +0100	[thread overview]
Message-ID: <87egbpdqb4.fsf@gnu.org> (raw)
In-Reply-To: <B393F5AD12955C48A84FFB08032CD04F6C47D242@ECS-EXG-P-MB01.win.lanl.gov> (Davis Herring's message of "Wed, 2 Mar 2016 23:21:19 +0000")

"Herring, Davis" <herring@lanl.gov> writes:

>> I don't see why using " fixes anything. All these files have to compile
>> with -I anyway, because builders don't need to build Emacs in the source
>> directory.  We might actually be better off using '<' for all includes.
>
> Except for generated headers, most of these could be relative includes, which is the usual meaning of #include"".

It will work for generated headers too.  Since '"' includes are a
superset of '<' includes as documented in GNU 'cpp' info manual.
However I don't know if this behavior is enforced by other c processors.

--8<---------------cut here---------------start------------->8---
Both user and system header files are included using the preprocessing
directive '#include'.  It has two variants:

'#include <FILE>'
     This variant is used for system header files.  It searches for a
     file named FILE in a standard list of system directories.  You can
     prepend directories to this list with the '-I' option (*note
     Invocation::).

'#include "FILE"'
     This variant is used for header files of your own program.  It
     searches for a file named FILE first in the directory containing
     the current file, then in the quote directories and then the same
     directories used for '<FILE>'.  You can prepend directories to the
     list of quote directories with the '-iquote' option.
--8<---------------cut here---------------end--------------->8---

I agree with Paul that this won't fix anything.  However I think keeping
using '"' includes have the semantic benefit of emphazing what headers
are part of Emacs which is helpful for people not familiar with the code
base.

In the case of config.h, using '"' could help emphasizing that is not a
system header but one can argue it could equally confuse people since it
is a generated file.  c-ctype.h is imported from Gnulib so should not be
considered part of Emacs so it would be better to keep using '<'.

-- 
Mathieu Lirzin



  reply	other threads:[~2016-03-05 13:09 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 [this message]
2016-03-05 13:57       ` Herring, Davis
2016-03-05 17:39         ` Paul Eggert
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=87egbpdqb4.fsf@gnu.org \
    --to=mthl@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=herring@lanl.gov \
    --cc=me@wilfred.me.uk \
    /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.