unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21707@debbugs.gnu.org
Subject: bug#21707: include-file cleanup for src directory
Date: Tue, 20 Oct 2015 11:50:34 -0700	[thread overview]
Message-ID: <56268CFA.6040708@cs.ucla.edu> (raw)
In-Reply-To: <83oaftfulj.fsf@gnu.org>

Eli Zaretskii wrote:
> Would it help if we avoid including any of our headers in any
> other of our headers, so that the headers included by a particular C
> file are visible by just looking at that single C file?

That would run afoul of a more important design goal, which is that we should be 
able to include headers in any order. And anyway, compiling a typical C file 
ordinarily brings in oodles of system headers that the C file doesn't explicitly 
ask for, so regardless of our style the only practical way to see what headers a 
C file includes is to compile it and see what gcc -E outputs.

Ideally a C source file should include all headers that define symbols the 
source file directly uses, and no headers other than that. This should be true 
for both .h and .c files. We're not there by a long shot, but that should be the 
goal.






  reply	other threads:[~2015-10-20 18:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19  7:05 bug#21707: include-file cleanup for src directory Paul Eggert
2015-10-19  7:23 ` Eli Zaretskii
2015-10-19 12:54   ` Andy Moreton
2015-10-19 13:23     ` Eli Zaretskii
2015-10-20  5:54   ` Paul Eggert
2015-10-20  8:23     ` Andy Moreton
2015-10-20 15:06       ` Eli Zaretskii
2015-10-20 15:06     ` Eli Zaretskii
2015-10-20 18:50       ` Paul Eggert [this message]
2015-10-20 19:15         ` Eli Zaretskii
2015-10-20 20:52           ` Paul Eggert
2015-10-20 19:28         ` Andy Moreton
2015-10-21  1:38 ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=56268CFA.6040708@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=21707@debbugs.gnu.org \
    --cc=eliz@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).