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 597937 - Function pointers as parameters to other functions are parsed improperly
Function pointers as parameters to other functions are parsed improperly
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
1.11
Other Linux
: Normal normal
: 1.16
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-09 18:46 UTC by Philip Chimento
Modified: 2010-10-04 09:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix bug and add testcase (3.49 KB, patch)
2010-10-02 08:22 UTC, Philip Chimento
committed Details | Review

Description Philip Chimento 2009-10-09 18:46:32 UTC
I have the following function prototype in a source file:

void 
gidispatch_set_object_registry(gidispatch_rock_t (*regi)(void *obj, glui32 objclass), void (*unregi)(void *obj, glui32 objclass, gidispatch_rock_t objrock))

This shows up as follows in the documentation:

void                gidispatch_set_object_registry      (gidispatch_rock_t (regivoid *obj, glui32 objclass) (),
                                                         void (unregivoid *obj, glui32 objclass, gidispatch_rock_t objrock) ());
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2010-01-15 16:11:14 UTC
Please use a typedef for the parameter.
Comment 2 Philip Chimento 2010-04-27 22:12:00 UTC
Adding API is not an option in this case. I can live with the WONTFIX resolution, but since 0.14 these generate warnings ("Parameter description for gidispatch_set_object_registry::regi is not used from source code comment block.") and entries in *-unused.txt. Can there at least be some option to keep these out of *-unused.txt?
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2010-04-28 10:44:37 UTC
How to classify these? gtk-doc cannot parse the prototype and this results in nonsense data and thus non-sense warnings. I could possibly add options to turn certains warnings on and off (I actually think about adding GTK_DOC_WARNING_FLAGS env-var for some time), but that would in your case also supress valid warnings :/.
Comment 4 Philip Chimento 2010-04-28 19:04:44 UTC
The warnings don't matter so much, the entries in *-unused.txt are more annoying. If I hacked something up to parse function pointers, would you be likely to commit it? Or is the WONTFIX for another reason?
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2010-04-29 08:15:59 UTC
If you have a patch, please attach. Please also run the tests before (make check).
Bonus points for adding a case to tests/bugs/src/tester.{c,h}.

Also please reopen the bug, if you attatch a patch.
Comment 6 Philip Chimento 2010-04-29 09:29:54 UTC
Ok, I'll see what I can do. I'm a bit busy right now so it may take a while but when I have something I'll reopen the bug.

PS. How do I reopen it?
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2010-04-30 06:29:23 UTC
I have reopened it, take your time for the patch and thanks for helping.
Comment 8 Philip Chimento 2010-10-02 08:22:12 UTC
Created attachment 171555 [details] [review]
Patch to fix bug and add testcase

It was a lot simpler than I expected - the functionality was already there, just broken ;-)

This patch fixes the bug and adds a testcase.
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-04 08:56:37 UTC
Thanks a lot for the patch. Applied.

commit 8688e1d689d498f541d0f64ca141b503c9620837
Author: P. F. Chimento <philip.chimento@gmail.com>
Date:   Mon Oct 4 11:54:27 2010 +0300

    Fix functions with function pointer arguments
    
    This patch fixes bug #597937 and adds a test case.