[splint-discuss] glib header and empty #define's

Ralf Wildenhues Ralf.Wildenhues at gmx.de
Wed Feb 27 11:48:36 PST 2008


Hi Brian,

* Brian Quinlan wrote on Wed, Feb 27, 2008 at 08:20:47PM CET:
> On Tue, 2008-02-26 at 15:19 -0800, Jack T Mudge III wrote:
> > 
> > in /usr/include/glib-2.0/glib/gmacros.h
> > /* Guard C code in headers, while including them from C++ */
> > #ifdef  __cplusplus
> > # define G_BEGIN_DECLS  extern "C" {
> > # define G_END_DECLS    }
> > #else
> > # define G_BEGIN_DECLS ;
> > # define G_END_DECLS ;

These two lines look buggy.  The gmacros.h on my system defines these
macros to be empty here.

> > #endif

> > /usr/include/glib/gtypes.h:41:8: Parse Error: Non-function declaration:
> >     G_BEGIN_DECLS : int. (For help on parse errors, see splint -help
> >     parseerrors.)

Make your own copy of the header, point splint at it with suitable -I
switches, and either annotate the macros with /*@notfunction@*/ or put 
them in "#ifndef __LCLINT__" blocks (there is a newer macro for splint
but I forgot its name).

Hope that helps.

Cheers,
Ralf


More information about the splint-discuss mailing list