MantisBT - VTK
View Issue Details
0013177VTK(No Category)public2012-05-15 13:282012-09-02 09:08
Eric Nodwell 
David Gobbi 
lowminorhave not tried
closedfixed 
5.8.0 
 
TBD
incorrect functionality
0013177: Python wrapping of argument names beginning with "const" fails
Python wrapping of methods in VTK classes that have arguments starting with "const" fail. For example, if one adds this method to a class in vtkMy, it will fail to be Python wrapped:

  virtual int AddConstraint(const char* constraintName);

The work-around is trivial, as simply renaming "constraintName)" to something like "arg_constraintName" will work. However, it is a head-scratcher to figure out in the first place.

This affects versions 5.6 through 5.10, but not 5.4 and earlier.
No tags attached.
Issue History
2012-05-15 13:28Eric NodwellNew Issue
2012-05-15 14:55David GobbiAssigned To => David Gobbi
2012-05-15 14:55David GobbiStatusbacklog => tabled
2012-05-15 15:06David GobbiNote Added: 0028603
2012-09-02 09:08David GobbiNote Added: 0029102
2012-09-02 09:08David GobbiStatustabled => closed
2012-09-02 09:08David GobbiResolutionopen => fixed

Notes
(0028603)
David Gobbi   
2012-05-15 15:06   
Thanks for the report. I looked through vtkParse.l to see if there are any bad rules that might cause this. I found this one:

"*"[\r\n\t ]*"const"

This rule catches any "*" followed by "const", even if "const" is part of a longer word. So the wrappers see "const char* constraintName" as "const char* const".

I'll modify the rule so that it only matches if the "const" is not followed by any other alphanumeric characters. The change will be targeted for VTK 6.
(0029102)
David Gobbi   
2012-09-02 09:08   
This was addressed by a rewrite of vtkParse.l (commit 4c6f2f79). The fix will be present in VTK 6.