GNOME Bugzilla – Bug 708366
#if !defined(__GTK_DOC_IGNORE__) not working
Last modified: 2015-04-27 20:09:17 UTC
#if !defined (__GI_SCANNER__) && !defined(__GTK_DOC_IGNORE__) /* For backwards compatibility */ typedef BugArgument BgArgument; #endif Does not seem to works, but changing the pre-processor directives to a nested structure like the following does however work: #ifndef __GI_SCANNER__ #ifndef __GTK_DOC_IGNORE__ /* For backwards compatibility */ typedef BugArgument BgArgument; #endif #endif Will attach (failing) testcase in a moment or two...
Created attachment 255299 [details] [review] tests: #if !defined(__GTK_DOC_IGNORE__) not working
The code does not handle the full cpp syntax, especially it does not handle !defined.
Code is here: https://git.gnome.org/browse/gtk-doc/tree/gtkdoc-scan.in#n361 this needs some work anyway to understand the difference between ifdef and ifndef, although I doubt it will understand kind of logical statements ...
The tools like gtkdoc won't have enough context to reason on e.g. __GI_SCANNER__ to eval the expression. All we could do is print a WARNING, if we see __GTK_DOC_IGNORE__ in such an expression. Otherwise I lean to close it as WONTFIX. What do you think?
Another option might be to just mention this limitation on https://developer.gnome.org/gtk-doc-manual/1.20/documenting.html.en """ The scanner can handle the majority of C headers fine. In the case of receiving warnings from the scanner that look like a special case, one can hint GTK-Doc to skip over them. Note that GTK-Doc's supports #ifndef(__GTK_DOC_IGNORE__) but not #if !defined(__GTK_DOC_IGNORE__). """ Or something along those lines...
commit 27a5c3df5ca4e46eb519fa95076efdc31cc98f18 Author: Stefan Sauer <ensonic@users.sf.net> Date: Mon Apr 27 22:06:21 2015 +0200 docs: document the limitations of the __GTK_DOC_IGNORE__ conditional See https://bugzilla.gnome.org/show_bug.cgi?id=708366