This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Projects for beginners
- To: James Dennett <jdennett at acm dot org>
- Subject: Re: Projects for beginners
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Thu, 1 Feb 2001 15:17:57 +1100
- Cc: gcc at gcc dot gnu dot org, Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- References: <10101312334.AA04092@vlsi1.ultra.nyu.edu> <3A78D2D9.FB8D802@acm.org>
On 01-Feb-2001, James Dennett <jdennett@acm.org> wrote:
> Richard's comments are, IMO, wrong. The reason is that we should
> be able to include any header "x.h" without having to know about
> which headers it needs; for any header "x.h" the following should
> be a legal translation unit:
>
> /* xtest.c -- Test that "x.h" is self-contained */
> #include "x.h"
> /* EOF */
I agree.
For the Mercury runtime library, we have a rule in the Makefile that
checks this automatically, by creating such files and compiling them.
This rule is invoked by our nightly test script.
It might be a good idea to do the same kind of thing for GCC.
Probably starting off with only a very small list of header files
for which the test is run, but it could be extended over time.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.