Duplicate ID errors for enums and structs
Submitted by Yeti
Building the documentation of a package that does not explicitly exclude headers generated by glib-mkenums leads to duplicate ID errors from xsltproc. This is a regression as it used to work fine in 1.15.
The errors look like
../xml/menu.xml:59: element refsect2: validity error : ID GwyMenuSensFlags already defined `<refsect2 id="GwyMenuSensFlags" role="enum">`
and appear because both the
<refect2> with the enum description and the
<anchor> in the summary gets the same ID, namely GwyMenuSensFlags here.
Why it happens?
The anchors in the summary are generated for symbols for which CheckIsObject() returns true. This is anything present in the hierarchy file. But if an enum or flag type was scanned it was also introspected. And if it was introspected it appears as a child or GEnum/GFlags type in the hierarchy file. Bang!
A quick workaround is to disable scanning of glib-mkenums generated headers. Unfortunately this does not make existing tarballs compile. Also, I do not like it as a permanent solution because at the end I would like to see all enum and flag types listed in the generated docs in a kind of hierarchy.
I don't know what has changed since 1.15 in this regard.