From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathieu Lirzin Newsgroups: gmane.emacs.devel Subject: Re: Using " rather than < for header files in Emacs Date: Sat, 05 Mar 2016 14:09:35 +0100 Message-ID: <87egbpdqb4.fsf@gnu.org> References: <56D772EC.5070509@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1457183407 11812 80.91.229.3 (5 Mar 2016 13:10:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Mar 2016 13:10:07 +0000 (UTC) Cc: Paul Eggert , emacs-devel , Wilfred Hughes To: "Herring\, Davis" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 05 14:10:00 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1acBy4-00040c-3S for ged-emacs-devel@m.gmane.org; Sat, 05 Mar 2016 14:10:00 +0100 Original-Received: from localhost ([::1]:46463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acBy3-0002Oi-Eh for ged-emacs-devel@m.gmane.org; Sat, 05 Mar 2016 08:09:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acBxo-0002OX-3S for emacs-devel@gnu.org; Sat, 05 Mar 2016 08:09:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acBxj-00049O-4E for emacs-devel@gnu.org; Sat, 05 Mar 2016 08:09:44 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acBxj-00049K-1A; Sat, 05 Mar 2016 08:09:39 -0500 Original-Received: from mek33-4-82-236-46-88.fbx.proxad.net ([82.236.46.88]:44366 helo=godel) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1acBxi-0006uz-8i; Sat, 05 Mar 2016 08:09:38 -0500 In-Reply-To: (Davis Herring's message of "Wed, 2 Mar 2016 23:21:19 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200944 Archived-At: "Herring, Davis" 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 ' 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 ''. 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