[GCC-XML]Re: function argument's name of fundamental type in gccxml output file

Brad King brad.king at kitware.com
Mon May 27 09:19:50 EDT 2002


Valery,

> We can not find the option of receiving the names of functions'
> arguments, if there are fundamental types. In case of fundamental type
> only the type is present.

I'm unable to duplicate your specific problem with GCC-XML 0.2.  However,
you may have reached this situation:

struct A {};
void f(A a, int i) {}    // Argument names given by GCC-XML.
void g(A a, int i);      // Argument names not given by GCC-XML.

GCC-XML only dumps the argument names given in a funciton's definition.  
If only the declaration is present, the names are ignored.  This is
because GCC's parser throws away the name of an argument in a forward
declaration.  The reason is that this is legal:

void f(int i);
void f(int j);
void f(int k);

Which name should be used?  The same function is forward declared several
times.  Only when the function definition occurs can the name be
determined.  In this example, there is no name:

void f(int) {}

Basically, if the function body definition is not present, the argument
names will not be dumped.

-Brad





More information about the gccxml mailing list