Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: jtc@redback.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [RFA]: Remove unused header files.
Date: Mon, 05 Mar 2001 08:11:00 -0000	[thread overview]
Message-ID: <3AA2C7A5.82230F3D@cygnus.com> (raw)
In-Reply-To: <5mitltndwn.fsf@jtc.redback.com>

"J.T. Conklin" wrote:

> In several instances it identified two header files, <errno.h> and
> <linespec.h>, as unnecessary because <errno.h> is unconditionally
> included in defs.h; and the only declaration in linespec.h
> (decode_line_1) is also defined in symtab.h.
> 
> I'm unsure about the correct way to handle those are.  As long as
> errno.h is included in defs.h, I see no reason to include it in any
> *.c file.  One could argue that errno.h should be remove from defs.h,
> but since errno (or the E* macros) is used in almost every file, I
> suspect we'd have to #include it in many files.

I'm aware of two strategies:

	o	Every module include a
		single header file and
		that suck in all the other
		header files.

		Makes for very simple but
		absolutely lethal make file
		dependencies :-)

	o	Every module define their
		own header and each component
		pull in the header files it
		is using.

		A variation on this theme has
		each of these header files
		[not] sucking in anything they
		refer to.

GDB clearly has a foot in both of those camps (and the second foot has
both of those variations squished between its toes .... :-).

"defs.h" contains declarations that various modules can't live without. 
Each module header contains declarations specific to their module.  How
self contained a module header file is,  is pretty arbitrary.

To get back to your question.  I expect the status quo to largely
remain:

	o	defs.h provide declarations for
		the things that all of GDB uses.

	o	module headers try to be largely
		self contained.  If they refer
		to other headers then suck
		those headers in.

So <errno.h> should be included but (to give a counter example)
<endian.h> should be given the boot (see TODO file for details).

	Andrew


  parent reply	other threads:[~2001-03-05  8:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-01 17:44 J.T. Conklin
2001-03-02  8:25 ` Andrew Cagney
2001-03-02 16:34   ` J.T. Conklin
2001-03-05  8:11     ` Andrew Cagney
2001-03-06 13:08       ` J.T. Conklin
2001-03-05  8:11 ` Andrew Cagney
2001-03-06 13:10   ` J.T. Conklin
2001-03-05  8:11 ` Andrew Cagney
2001-03-06 12:41   ` J.T. Conklin
2001-03-05  8:11 ` Andrew Cagney
2001-03-06  9:20   ` Fernando Nasser
2001-03-06 11:32     ` J.T. Conklin
2001-03-06 13:27   ` J.T. Conklin
2001-03-06 15:06     ` Andrew Cagney
2001-03-05  8:11 ` Andrew Cagney [this message]
2001-03-06 13:02   ` J.T. Conklin
2001-03-05  8:11 ` Andrew Cagney
2001-03-06 12:38   ` J.T. Conklin

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=3AA2C7A5.82230F3D@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=gdb-patches@sourceware.cygnus.com \
    --cc=jtc@redback.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox