[GCC-XML] gccxml-bodies: Trouble with errorcount

Brad King brad.king at kitware.com
Wed Jul 30 16:18:32 EDT 2008


dj at djlauk.de wrote:
> It took a while, but I am finally updating to the "gccxml-gcc42-bp",
> just before the switch to GCC 4.2.

Great!

> I had to manually replay several changes, but in the end it all worked out OK.
> 
> Well, almost. Because now it doesn't build anymore :-(
> 
> I get this message:
> ......xml.c:101: error: `errorcount' undeclared (first use in this function)
> 
> I took the declarations part from xml.c and put it in a new xml.h file.
> There it says
> 
> #if defined(GCC_XML_GCC_VERSION) && (GCC_XML_GCC_VERSION >= 0x030100)
> # include "diagnostic.h"
> #else
> extern int errorcount;
> #endif
> 
> So this should work, right?

This block of decls can stay in "xml.c" because you should not need it
in "xml_body.c".  The purpose is to use the errorcount to skip dumping
if error occurred during parsing.  By the time your body hook is invoked
the check should already have been done.

One reason the block might not be working is that it must come after

  #include "system.h"

to get that macro definition.

-Brad



More information about the gccxml mailing list