new switch that warns about missing includes

Fergus Henderson fjh@cs.mu.oz.au
Wed Aug 8 19:34:00 GMT 2001


On 08-Aug-2001, Florian Schintke <schintke@zib.de> wrote:
> I am thinking of a switch for the gcc that warns you about missing
> includes of standard header files to get higher reliablity of your
> code.
...
> I don't know exectly how to implement this. Maybe you are
> interested to think about it.

I've been using the following Makefile recipe, which will catch some
but not all cases of header files which are not properly self-contained.

	HDRS = foo.h bar.h baz.h

	check: $(HDRS:%.h=%.check.o)

	%.check.c : %.h
		echo "#include \"$*.h\"" > $@

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh >  |     -- the last words of T. S. Garp.



More information about the Gcc mailing list