GNOME Bugzilla – Bug 753052
_() causes element a: validity error : ID idx already defined
Last modified: 2016-03-24 18:10:42 UTC
gtkdoc-scan used to skips all functions and macros starting with an underscore as private. Except that code contains a special exception for the _() macro which is therefore included: # We assume all macros which start with '_' are private, but # we accept '_' itself which is the standard gettext macro. However, if the macro actually is defined, this leads to the error element a: validity error : ID idx already defined during index construction because the following snippet is generated in the index (with specific library/file name obviously varying): <div class="index"> <div class="titlepage"><div><div><h1 class="title"> <a name="api-index-all"></a>Index of all symbols</h1></div></div></div> <a name="idx"></a><a name="idx"></a><h3 class="title"></h3> <dt> <a class="link" href="libgwyddion-gwymacros.html#gettext-macro" title="_()">_</a>, macro in <a class="link" href="libgwyddion-gwymacros.html" title="gwymacros">gwymacros</a> That is the ID "idx" is used both for the entire index and the portion with symbols starting with _. Personally, I do not see much point in documenting the standard gettext macro _() in Gtk+ packages. But if it is to stay the ID generation logic needs to be improved to avoid the ID clash.
Edit: the first sentence does not make sense, sorry. It should start gtkdoc-scan skips all...
When you you say "However, if the macro actually is defined, this leads to the error" you mean defined as in #define _(String) gettext(String) or do you mean that the macros is also documented? personally I exclude those from the docs using this in the Makefile.am IGNORE_HFILES=core_private.h having the gettext macros in a separate header that is only included from .c files in the lib also make sense as this makes it easy to not install this header (noinst_HEADERS).
Regardless, I'll make a patch to not use the same index id twice. This could also happen if someone defines a macro "A()".
commit c7c56747e070b8d5e203a3be1fc75be014c6465d Author: Stefan Sauer <ensonic@users.sf.net> Date: Thu Mar 24 18:56:13 2016 +0100 mkdb: avoid duplicated id='idx' We're stripping leading '_' from names when sorting them into buckets. This would leave us with an empty buckname name for the macro "_". Fixes #753052
commit 070acc51771b0e9b839d72264889ebbc1c2e6f13 Author: Stefan Sauer <ensonic@users.sf.net> Date: Thu Mar 24 19:06:10 2016 +0100 scan: remove special case for '_' macro As discussed in #753052, the special case for '_' is not very useful. The '_' macro is not part of the library API anyway. Further this is inconsitent w.r.t the _N() macros and others. Hence remove the special case.