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 638330 - const in parameter list is ignored
const in parameter list is ignored
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: 1.16
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2010-12-30 09:37 UTC by Maarten Bosmans
Modified: 2011-01-10 12:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix missing const in parameter list (1.67 KB, patch)
2010-12-30 09:41 UTC, Maarten Bosmans
none Details | Review

Description Maarten Bosmans 2010-12-30 09:37:07 UTC
If const is combined with another keyword (e.g. unsigned) in a function parameter list, it is ignored in the output.

Example code showing the bug:

cairo_status_t      (*cairo_write_func_t)               (void *closure,
                                                         const unsigned char *data,
                                                         unsigned int length);

In the generated docs the const is missing, see also https://bugs.freedesktop.org/show_bug.cgi?id=28060
Comment 1 Maarten Bosmans 2010-12-30 09:41:28 UTC
Created attachment 177246 [details] [review]
Fix missing const in parameter list

This patch resolves the bug.

The regex can obviously be simplified more by removing the double keywords ('unsigned long', etc.) from the list of alternatives, but this is the smallest change that resolves the bug
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2011-01-10 12:38:29 UTC
Thanks for tracking it down. The patch was against a generated file instead of the .in file. I change it and also added a test case. Please consider filing git formatted patches in the future. Those contain the commit comment and you as the author already :)

commit 4cfc71cd836d73b15254f73f58d8fd5f85fcc1f6
Author: Maarten Bosmans <mkbosmans@gmail.com>
Date:   Mon Jan 10 14:35:16 2011 +0200

    parsing: improve parsing of arguments
    
    The 'const' in a 'const unsigned char *xxx' parameter was dropped. Add test-case
    as well. Fixes #638330.