Bug Tracker




Note: GCC-XML has been succeeded by CastXML.

Frequently asked questions are listed here with answers:
  1. Does GCC-XML work with pure C code too?
    Yes and no. GCC-XML is written as an extension to GCC's C++ parser and therefore treats all source files as C++ regardless of their extension. If the C code happens to be valid C++ then GCC-XML will handle it. There are a few parts of C not included in C++ that will cause GCC-XML to produce errors. These are documented in Annex C of the C++98 Standard.
  2. Why are C++ function bodies not dumped in XML?
    The original sponsors of the project had no need for function bodies. So far the authors have not had time or funding to implement the support.
  3. Is there a DTD specifying the XML format dumped?
  4. Why are most classes, structs, and enums marked as "artificial"?
    The artificial attribute marks nodes that are artificially generated by the compiler (such as implicit copy constructors). The C++ code
    struct foo {};
    is almost the same as the C code
    struct foo {};
    typedef struct foo foo;
    because the C++ compiler adds the typedef artificially. The name foo for the struct shown above is reported as the name in the Struct element in the XML output, but this name was artifically generated so that programmers would not have to write struct foo.
  5. Why don't I see templates in the output?
    This feature has not been implemented because the driving project for which GCC-XML was written had no need for uninstantiated templates. Template instantiations will still be dumped, though. For example:
    template <class T> struct foo {};
    typedef foo<int>::foo foo_int;
    will instantiate foo<int>, which will be included in the output. However, there will be no place that explicitly lists the set of types used for the instantiation other than in the name. This is because the proper way to do it is to dump the templates too and reference them from the instantiations with the template arguments listed. Since the features will be linked they should be implemented together.