GNOME Bugzilla – Bug 597937
Function pointers as parameters to other functions are parsed improperly
Last modified: 2010-10-04 09:11:31 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) ());
Please use a typedef for the parameter.
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?
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 :/.
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?
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.
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?
I have reopened it, take your time for the patch and thanks for helping.
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.
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.