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 322035 - wrong macro parsing
wrong macro parsing
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: 1.9
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-21 14:33 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2007-09-23 14:16 UTC
See Also:
GNOME target: 2.20.x
GNOME version: ---



Description Stefan Sauer (gstreamer, gtkdoc dev) 2005-11-21 14:33:17 UTC
if one uses macros-docs like this
/**
 * GST_ERROR_SYSTEM:
 *
 * Returns a string using errno describing the previously failed system
 * call.  To be used as the debug argument in #GST_ELEMENT_ERROR.
 */
#define GST_ERROR_SYSTEM    ("system error: %s", g_strerror (errno))
then the macro appears in the undocumented list

changing the docs to 
/**
 * GST_ERROR_SYSTEM:
 *
 * Builds a string using errno describing the previously failed system
 * call.  To be used as the debug argument in #GST_ELEMENT_ERROR.
 */
works around the problem.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2005-11-23 19:28:25 UTC
It is in gtkdoc-mkdb.in:2776

if (!$ignore_returns && m%^\s*(returns:|return\s+value:|returns\s*)%i) {
  $return_start = $1;
  $return_desc = $';
  $in_return = 1;
  next;
}

Do we really want to allow 'Return' (without a ':') to start a returns: section.
IMHO even 'return value:' is one variant to much.
Comment 2 Damon Chaplin 2005-11-24 11:16:11 UTC
I allowed those since that was what the GNOME people were using in their docs
before they started using gtk-doc.

I don't really think we can change that now, as it might break a lot of docs.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2005-11-24 13:47:31 UTC
I did some grepping over e.g. gtk sources and I don'T think it breaks alot. The
use sentences such as "Returns this and that" but also have a "Returns:"
paragraph. Anyway for now I add it to the FAQ.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2006-03-21 10:56:59 UTC
What about a warning in this case to help people to fix the old usage?
Comment 5 Damon Chaplin 2006-03-25 12:07:14 UTC
I wouldn't mind a warning.

Note that in your original example gtk-doc was probably correct, as the macro
does return a value and that should be documented, as well as the macro itself.
Comment 6 Yeti 2007-07-09 20:17:38 UTC
The patches in bug 380824 should address these issues.