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 322556 - Doesn't parse const after type
Doesn't parse const after type
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
1.4
Other All
: Normal normal
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-27 12:30 UTC by Sven Herzberg
Modified: 2006-01-24 15:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
allows no space between 'const' and '*' (3.34 KB, patch)
2005-12-07 14:50 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review
test case (1013 bytes, application/x-perl)
2005-12-07 14:51 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
  Details

Description Sven Herzberg 2005-11-27 12:30:46 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.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2005-11-28 14:21:04 UTC
Its the order of const and type.
'const gchar*' works
'gchar const*' does not

Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2005-12-07 14:28:58 UTC
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 :(
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2005-12-07 14:50:49 UTC
Created attachment 55748 [details] [review]
allows no space between 'const' and '*'

the patch also fixes a usage of an undefined variable
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2005-12-07 14:51:45 UTC
Created attachment 55749 [details]
test case

the attached perl-script can be used to test the change stand-alone
Comment 5 Damon Chaplin 2005-12-08 20:27:43 UTC
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/)"
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2006-01-24 15:51:34 UTC
indee, commited to cvs