[GCC-XML]"__thread" now a reserved word in gcc 3.3

Brad King brad.king at kitware.com
Thu Mar 4 17:30:35 EST 2004


Dan Halbert wrote:

> Hi, I am using gccxml in conjunction with Boost.Python's pyste tool.
> 
> I was using gccxml-0.4.2, but wanted to switch to 0.6.0 because of the
> support for exception specifiers.
> 
> We are using gcc 3.2.2 on a RH7.3 system. As of gcc 3.3, "__thread"
> has become a reserved word. This causes problems with my RH7.3
> /usr/include/pthread.h, which happens to use "__thread" as an ordinary
> variable name.
> 
> I #include <pthread.h> in the code I run through gccxml.
> Without patching my pthread.h, is it possible to get gccxml-0.6.0
> not to treat  "__thread" as a reserved word? I thought it could
> imitate the behavior of previous compilers, but perhaps this is
> an exception.
> 
> I have tried rebuilding gccxml-0.6.0 from scratch, using my gcc 3.2.2
> as its basis. But the problem persists.

I have seen this problem when simulating 2.95 and 2.96 versions of GCC, 
but this is the first time I've seen it for GCC 3.3.  Since the conflict 
is with pthread.h, the problem could conceivably occur for any compiler.
Since parsing other compiler's headers is a general problem for GCC-XML, 
there is a general solution.  The Support directory in the source tree 
contains a set of patched headers from various supported compilers. 
These fixed headers are found by GCC-XML's preprocessor before those on 
the system.

There is a directory called GCC_XML/Support/GCC/2.95 in the GCC-XML 
source tree.  Copy the file pthread.h from that directory to 
GCC_XML/Support/GCC/3.3.  This should add the pthread.h fixes to the 
simulation of the GCC 3.3 compiler.  Let me know if this fixes your 
problem and I'll commit the fix upstream.

Thanks,
-Brad




More information about the gccxml mailing list