GNOME Bugzilla – Bug 322556
Doesn't parse const after type
Last modified: 2006-01-24 15:51:34 UTC
Please describe the problem: gtk-doc doesn't seem to be able to parse arguments like: "gchar const* text" Steps to reproduce: I have the following section within a header: ---8<---8<---8<---8<---8<---8<---8<---8<--- CcItem* cc_text_new(gchar const* text); --->8--->8--->8--->8--->8--->8--->8--->8--- Actual results: gtk-doc cries. gtkdoc-mkdb --module=ccc --source-dir=../../ccc --output-format=xml --expand-content-files="" --sgml-mode --output-format=xml ###Can't parse args for function cc_text_new: gchar const* text Expected results: gtk-doc should treat "gchar const* text" the same way it treats "const gchar* text" Does this happen every time? Yep, always, on any machine, with 1.4 and with HEAD. Other information: No, thanks.
Its the order of const and type. 'const gchar*' works 'gchar const*' does not
this regexp in gtkdoc-mkdb:1259 would need a change: if ($declaration =~ s/^(const\s+|G_CONST_RETURN\s+|unsigned\s+)*(struct\s+)?((?:long\s+|short\s+)?\w+)\s*(\**(?:\s*restrict)?)\s*(const\s+)?(\**(?:\s*restrict)?)?\s*(\w+)?\s*((?:\[\S*\])*)\s*[,\n]//) I am scared :(
Created attachment 55748 [details] [review] allows no space between 'const' and '*' the patch also fixes a usage of an undefined variable
Created attachment 55749 [details] test case the attached perl-script can be used to test the change stand-alone
Yes, that looks fine. There is a bug in the existing code, though. - elsif ($flags =~ m/l/) { - $flags_string = "Cleanup"; - } I think that should be "elsif ($flags =~ m/c/)"
indee, commited to cvs