This is the mail archive of the
mailing list for the GDB project.
Re: symfile.h missing "#include "symtab.h" ?
- From: Daniel Jacobowitz <drow at false dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 20 Mar 2007 21:54:10 -0400
- Subject: Re: symfile.h missing "#include "symtab.h" ?
- References: <20070321004620.GD21799@adacore.com>
On Tue, Mar 20, 2007 at 05:46:20PM -0700, Joel Brobecker wrote:
> 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
> /* 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.