new switch that warns about missing includes
Florian Schintke
schintke@zib.de
Thu Aug 9 00:58:00 GMT 2001
[Fergus Henderson]
> 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\"" > $@
Thank you for this rule, Fergus Henderson. This helps for the case
that you include in a .c file more than one .h file and use in the
second .h file some things that are defined in the first .h file
included. I think it is a rather weak check and it does not help to
check what is done by includes done in the .h files itself.
Florian Schintke
--
Florian Schintke <schintke@zib.de>, http://www.zib.de/schintke/
More information about the Gcc
mailing list