After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 708366 - #if !defined(__GTK_DOC_IGNORE__) not working
#if !defined(__GTK_DOC_IGNORE__) not working
Status: RESOLVED WONTFIX
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-19 12:40 UTC by Dieter Verfaillie
Modified: 2015-04-27 20:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: #if !defined(__GTK_DOC_IGNORE__) not working (1.72 KB, patch)
2013-09-19 12:51 UTC, Dieter Verfaillie
none Details | Review

Description Dieter Verfaillie 2013-09-19 12:40:51 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...
Comment 1 Dieter Verfaillie 2013-09-19 12:51:38 UTC
Created attachment 255299 [details] [review]
tests: #if !defined(__GTK_DOC_IGNORE__) not working
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2014-02-08 17:44:14 UTC
The code does not handle the full cpp syntax, especially it does not handle !defined.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2014-02-08 17:56:14 UTC
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 ...
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2014-07-09 13:41:47 UTC
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?
Comment 5 Dieter Verfaillie 2014-07-11 14:19:36 UTC
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...
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2015-04-27 20:09:17 UTC
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