[GCC-XML] problem parsing struct declaration

Kang, Gene Y (N-Simulogix) gene.y.kang at lmco.com
Tue Oct 19 10:57:54 EDT 2004

GCC-XML seems to parse the following structure incorrectly due to the variable "d" structure declaration.

typedef struct {
   int a; 
   int b;
   int c;

   struct {
     int d_1;
     int d_2;
   } d;

   double e;
} stuff_t;

For example, the resulting XML output for stuff_t is:

<Struct id="_5" name="stuff_t" context="_1" mangled="7stuff_t" location="f0:16" file="f0" line="16" size="256" align="64"
members="_7 _8 _9 _10 _11 _12 _13 _14 " bases=""/>

Everything looks good except for "_12".  "_12" looks like a reference to an anonymous struct that's the same type as
that of d ("_10") :

<Struct id="_12" context="_5" mangled="N7stuff_t3._1E" location="f0:10" file="f0" line="10" artificial="1" size="64" align="32"
members="_16 _17 _18 _19 " bases=""/>

Is this what would be expected from the compiler?...if it is, sorry for the dumb question.  Note, I don't see this problem
if I change the struct declaration of "d" to a typedef.

By the way, my platform is Sun-Solaris8.

Thanks in advance for any help,

More information about the gccxml mailing list