MantisBT - VTK
View Issue Details
0013449VTK(No Category)public2012-09-12 07:592012-09-28 08:56
Pietro Cerutti 
David Gobbi 
normalminorhave not tried
closedfixed 
 
 
TBD
incorrect functionality
0013449: Invalid pointer conversion in vtkTkRenderWidget.cxx
in vtkTkRenderWidget.cxx, a return from calloc (void *) is assigned to a (char *).
No tags attached.
duplicate of 0013198closed David Gobbi compilation problem for vtktkrenderwidget 
cxx patch-Rendering_vtkTkRenderWidget.cxx (521) 2012-09-12 07:59
https://www.vtk.org/Bug/file/9277/patch-Rendering_vtkTkRenderWidget.cxx
Issue History
2012-09-12 07:59Pietro CeruttiNew Issue
2012-09-12 07:59Pietro CeruttiFile Added: patch-Rendering_vtkTkRenderWidget.cxx
2012-09-12 08:21David GobbiNote Added: 0029178
2012-09-12 08:34David GobbiRelationship addedduplicate of 0013198
2012-09-12 08:45Pietro CeruttiNote Added: 0029183
2012-09-12 09:05David GobbiNote Added: 0029185
2012-09-12 09:06Pietro CeruttiNote Added: 0029187
2012-09-28 08:51David GobbiAssigned To => David Gobbi
2012-09-28 08:51David GobbiStatusbacklog => tabled
2012-09-28 08:56David GobbiNote Added: 0029290
2012-09-28 08:56David GobbiStatustabled => closed
2012-09-28 08:56David GobbiResolutionopen => fixed

Notes
(0029178)
David Gobbi   
2012-09-12 08:21   
This is a duplicate of bug report 13198, perhaps you can be more helpful than the person who reported this before.

What version of Tcl/Tk are you using? All the documentation that I have read says that ckalloc() returns a "char *". And on every computer that I've ever built VTK on, ckalloc() returns a "char *". So why does it return a "void *" on your machine?
(0029183)
Pietro Cerutti   
2012-09-12 08:45   
It's tcl8.6,

# define ckalloc(x) \
    ((VOID *) Tcl_Alloc((unsigned)(x))

while tcl8.5 had

# define ckalloc(x) Tcl_Alloc(x)


And in both cases:
EXTERN char * Tcl_Alloc(unsigned int size);

I wasn't careful enough in the first place.. we should probably place a few casts around, surrounded by

#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 6
// cast here
#else
// no cast needed here
#endif
(0029185)
David Gobbi   
2012-09-12 09:05   
I'll just add the cast with a comment to say why it is necessary. The cast will work with all versions of Tcl.
(0029187)
Pietro Cerutti   
2012-09-12 09:06   
Makes sense to me. Thanks!
(0029290)
David Gobbi   
2012-09-28 08:56   
Fixed by commit 376579aa.