include file configuration

John Malmberg wb8tyw at
Mon Jan 21 19:45:02 GMT 2002

Martin Pool wrote:

> It looks to me like that would not damage anything.  I doubt if it
> would be much faster since we pull in so many other headers, but if
> running Splint helps then perhaps we can put it in.
> The other thing that might help would be
>   #ifndef _SPLINT_
> around the relevant headers.  This works well for lclint, which cannot
> parse some declarations and is happier having no declaration at all.
> Would you prefer that Andreas?

Compaq C also complains about unused header files at the warning level 
that I run it at.

The easiest way to do eliminate these is to bracket those include files 
that are not needed by all modules in the include.h file with:

#ifdef NEED_FOO.H
#include <foo.h>

And then in the modules that need the include file to have the following:

#define NEED_FOO_H 1
#include "include.h"

It looks like that SPLINT tool can identify any cases where this would 
be needed.

Then it both fixes the problem for SPLINT and slightly reduces the 
symbols that the compiler needs to keep track of.

wb8tyw at
Personal Opinion Only


More information about the samba-technical mailing list