This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Headers including other headers?
- From: Jim Blandy <jimb at redhat dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Sat, 23 Feb 2002 12:23:36 -0500 (EST)
- Subject: Headers including other headers?
Suppose a header file in gdb/ contains code cannot be compiled without
definitions from other header files --- it uses typedefs, structures
in a way that requires their size, etc. Is it more proper for the
header file to #include the other headers it requires itself, or
should it be the responsibility of the .c file #including it to also
bring in its prerequisites?
In hopes that this doesn't start a really long thread of unsatisfying
disagreements: I personally think that this is not a matter of huge
consequence either way, but it's nicer to have a consistent pattern,
so having someone simply establish any reasonable guideline is more
important than the actual details of that guideline.
I'm not volunteering to convert our existing headers; I just want to
know what style is recommended for new header files.