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 678094 - the word "returns" in a function description can be parsed as the "Returns:" section
the word "returns" in a function description can be parsed as the "Returns:" ...
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
1.15
Other Linux
: Normal normal
: 1.21
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2012-06-14 11:54 UTC by Dan Winship
Modified: 2014-07-10 08:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dan Winship 2012-06-14 11:54:08 UTC
I had a function like this:

/**
 * my_function:
 * @arg: arg
 *
 * This does some stuff. Don't use @arg again after the function
 * returns.
 *
 * Since: 3.4
 */

And it got parsed as though it was:

/**
 * my_function:
 * @arg: arg
 *
 * This does some stuff. Don't use @arg again after the function
 *
 * Returns: .
 *
 * Since: 3.4
 */

(I'm not sure if the "Since" tag was necessary to trigger the bug or not.)

There really ought to be a single mandatory standard format for the "Returns" line, rather than just sucking in anything that matches /^return/i.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2012-06-14 12:25:58 UTC
The last time I tried to remove the fallback for 'returns' people where afraid that it breaks existing docs :/ I'll write a mail to desktop and tell that people have time until the next release to fix their packages and I'll remove legacy support in git, so that people can quickly try it.

Does that sound like a plan?
Comment 2 Dan Winship 2012-06-14 13:35:44 UTC
worksforme.

You could maybe make it just print a warning for now, and then switch to rejecting it later.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2013-05-30 18:14:48 UTC
The warning is already there for ages. Just to clarify, is the my_function a void function (I guess so)?
Comment 4 Dan Winship 2013-05-30 18:54:56 UTC
I think so. (I don't remember what function it was now.)
Comment 5 Sébastien Wilmet 2014-05-10 20:19:53 UTC
A related problem with "returns", see the g_strsignal() documentation in GLib.

/**
 * g_strsignal:
 * @signum: the signal number. See the `signal` documentation
 *
 * Returns a string describing the given signal, e.g. "Segmentation fault".
 * You should use this function in preference to strsignal(), because it
 * returns a string in UTF-8 encoding, and since not all platforms support
 * the strsignal() function.
 *
 * Returns: a UTF-8 string describing the signal. If the signal is unknown,
 *     it returns "unknown signal (<signum>)".
 */

https://developer.gnome.org/glib/unstable/glib-String-Utility-Functions.html#g-strsignal
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2014-07-10 08:02:54 UTC
commit 5be5b88761bf4284c3a93f046247dd44ec85d874
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Thu Jul 10 07:26:32 2014 +0200

    mkdb: drop legacy 'return' description handling
    
    We don't recognize sentences starting with 'Returns' as return docs anymore.
    This was ambigous and we printed a warning for this since years.
    
    FIxes #678094