[GCC-XML] offset attribute problem

Brad King brad.king at kitware.com
Wed Oct 13 09:24:37 EDT 2004


Brad King wrote:
> Kang, Gene Y (N-Simulogix) wrote:
> 
>> Brad, I recompiled this time as a .cpp module with g++ as you 
>> suggested.  I still get 4 as my output.
> 
> 
> Okay.  I've built GCC-XML on a Sun and duplicated the problem.  Please 
> submit it as a bug report here:
> 
> http://www.gccxml.org/Bug
> 
> and you will automatically be notified when it is fixed.

Okay, nevermind about the bug report.  It was a simple fix:

/cvsroot/GCC_XML/gccxml/GCC_XML/xml.c,v  <--  xml.c
new revision: 1.91; previous revision: 1.90

Basically there was a HOST_WIDE_INT being printed with the "%u" format. 
   On the Sun HOST_WIDE_INT is "long long" and it is big endian so "%u" 
only accessed the first four bytes which were all zero.  It should be 
printed with HOST_WIDE_INT_PRINT_UNSIGNED macro, which is defined as 
"%llu" when HOST_WIDE_INT is "long long".

-Brad



More information about the gccxml mailing list