Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* symfile.h missing "#include "symtab.h" ?
@ 2007-03-21  0:45 Joel Brobecker
  2007-03-21  1:54 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Brobecker @ 2007-03-21  0:45 UTC (permalink / raw)
  To: gdb

Hello,

I noticed this today: If I include symfile.h without including
symtab.h first, I get a compilation error because domain_enum
is not defined.

I was about to send a patch to add the missing include, but then
noticed:

    /* This file requires that you first include "bfd.h".  */

Is this something we're intending to keep? Shouldn't we just
add the "#include "bfd.h" in that file? If not, then should we
treat "symtab.h" the same way?

Let me know what is prefered and I'll send a tested patch on thurday.

Thanks,
-- 
Joel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: symfile.h missing "#include "symtab.h" ?
  2007-03-21  0:45 symfile.h missing "#include "symtab.h" ? Joel Brobecker
@ 2007-03-21  1:54 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-03-21  1:54 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb

On Tue, Mar 20, 2007 at 05:46:20PM -0700, Joel Brobecker wrote:
> Hello,
> 
> I noticed this today: If I include symfile.h without including
> symtab.h first, I get a compilation error because domain_enum
> is not defined.

Yes, I noticed this before but never got around to fixing it.  Sorry.

> I was about to send a patch to add the missing include, but then
> noticed:
> 
>     /* This file requires that you first include "bfd.h".  */
> 
> Is this something we're intending to keep? Shouldn't we just
> add the "#include "bfd.h" in that file? If not, then should we
> treat "symtab.h" the same way?

bfd.h, as it happens, is special - because it's included by defs.h.
Other headers generally require that.  I don't think there should be
exceptions for other header dependencies, though.  So please fix it!

We try to use forward declarations instead of #include where
possible, but of course that doesn't work for an enum.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-21  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-21  0:45 symfile.h missing "#include "symtab.h" ? Joel Brobecker
2007-03-21  1:54 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox