Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Joel Brobecker <brobecker@gnat.com>
Cc: David Carlton <carlton@math.stanford.edu>,
	gdb-patches@sources.redhat.com
Subject: Re: [RFC] missing #include in frame.h?
Date: Wed, 09 Apr 2003 21:22:00 -0000	[thread overview]
Message-ID: <3E948EED.30801@redhat.com> (raw)
In-Reply-To: <20030409205611.GP1170@gnat.com>


>> But shouldn't all .c files inculde defs.h first?  (Indeed, that's what
>> GDB Internals says.)  Which file were you compiling when you got this
>> error?  Probably that file should be fixed to include defs.h before
>> frame.h, instead of changing frame.h.

> Ugh (excuse my French). If bla.h depends on defs.h, I think it is wrong
> to ask all c files including bla.h to include defs.h first... But I come
> from the Ada world, so maybe there is a good reason for this?

GDB's coding standard stipulates that all .c files include "defs.h" 
first; all other .h files can assume this.

> I dug a bit further, as my conclusions were a bit premature. Here is one
> include stack example when this happens:
> 
>         In file included from breakpoint.h:25,
>                          from gdbthread.h:29,
>                          from config/nm-lynx.h:49,
>                          from nm.h:24,
>                          from defs.h:767,
>                          from frame.c:23:
> 
> I checked frame.c, and it does include defs.h before frame.h. What
> actually happens is that nm.h is indirectly including frame.h before
> defs.h has included gdbarch.h... (nm.h = config/i386/nm-i386lynx.h,
> which is equivalent to config/nm-lynx.h).

Officially, "tm.h" and "nm.h" and "xm.h" are going away.  HP/UX's "tm.h" 
is even worse at this.

My hunch is that, in reality, "nm.h" won't so much go away as be made an 
explicit include by the native files that actually need it.

Andrew



  parent reply	other threads:[~2003-04-09 21:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-09 20:38 Joel Brobecker
2003-04-09 20:44 ` David Carlton
2003-04-09 20:56   ` Joel Brobecker
2003-04-09 21:08     ` David Carlton
2003-04-09 21:22     ` Andrew Cagney [this message]
2003-04-09 20:51 ` Andrew Cagney

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=3E948EED.30801@redhat.com \
    --to=ac131313@redhat.com \
    --cc=brobecker@gnat.com \
    --cc=carlton@math.stanford.edu \
    --cc=gdb-patches@sources.redhat.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