View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013449VTK(No Category)public2012-09-12 07:592012-09-28 08:56
ReporterPietro Cerutti 
Assigned ToDavid Gobbi 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0013449: Invalid pointer conversion in vtkTkRenderWidget.cxx
Descriptionin vtkTkRenderWidget.cxx, a return from calloc (void *) is assigned to a (char *).
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Filescxx file icon patch-Rendering_vtkTkRenderWidget.cxx [^] (521 bytes) 2012-09-12 07:59

 Relationships
duplicate of 0013198closedDavid Gobbi compilation problem for vtktkrenderwidget 

  Notes
(0029178)
David Gobbi (developer)
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 (reporter)
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 (developer)
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 (reporter)
2012-09-12 09:06

Makes sense to me. Thanks!
(0029290)
David Gobbi (developer)
2012-09-28 08:56

Fixed by commit 376579aa.

 Issue History
Date Modified Username Field Change
2012-09-12 07:59 Pietro Cerutti New Issue
2012-09-12 07:59 Pietro Cerutti File Added: patch-Rendering_vtkTkRenderWidget.cxx
2012-09-12 08:21 David Gobbi Note Added: 0029178
2012-09-12 08:34 David Gobbi Relationship added duplicate of 0013198
2012-09-12 08:45 Pietro Cerutti Note Added: 0029183
2012-09-12 09:05 David Gobbi Note Added: 0029185
2012-09-12 09:06 Pietro Cerutti Note Added: 0029187
2012-09-28 08:51 David Gobbi Assigned To => David Gobbi
2012-09-28 08:51 David Gobbi Status backlog => tabled
2012-09-28 08:56 David Gobbi Note Added: 0029290
2012-09-28 08:56 David Gobbi Status tabled => closed
2012-09-28 08:56 David Gobbi Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team