[Insight-developers] Annoying CSwig warning

Hans J. Johnson hans-johnson at uiowa . edu
Wed, 19 Nov 2003 14:44:57 -0600


Hello All,

I was annoyed by all the warning messages given by the ITK wrapping for
TCL compilations.  I've tracked down at least one of the main culprits,
and would request that those maintaining this consider implementing
these changes to tcl8.swg so that the function prototypes are correct:

diff ./SWIG/Lib/tcl/tcl8.swg ~/tcl8.swg
576c576
<     Tcl_PkgProvide(interp, (char*)SWIG_name, (char*)SWIG_version);
---
>     Tcl_PkgProvide(interp, (CONST char *)SWIG_name, (CONST
char*)SWIG_version);
588c588
<       Tcl_CreateObjCommand(interp, (char *) swig_commands[i].name,
(swig_wrapper_func) swig_commands[i].wrapper,
swig_commands[i].clientdata, NULL);
---
>       Tcl_CreateObjCommand(interp, (CONST char *)
swig_commands[i].name, (swig_wrapper_func) swig_commands[i].wrapper,
swig_commands[i].clientdata, NULL);
591,593c591,593
<       Tcl_SetVar(interp, (char *) swig_variables[i].name, (char *) "",
TCL_GLOBAL_ONLY);
<       Tcl_TraceVar(interp, (char *) swig_variables[i].name,
TCL_TRACE_READS | TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *)
swig_variables[i].get, (ClientData) swig_variables[i].addr);
<       Tcl_TraceVar(interp, (char *) swig_variables[i].name,
TCL_TRACE_WRITES | TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *)
swig_variables[i].set, (ClientData) swig_variables[i].addr);
---
>       Tcl_SetVar(interp, (CONST char *) swig_variables[i].name, (CONST
char *) "", TCL_GLOBAL_ONLY);
>       Tcl_TraceVar(interp, (CONST char *) swig_variables[i].name,
TCL_TRACE_READS | TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *)
swig_variables[i].get, (ClientData) swig_variables[i].addr);
>       Tcl_TraceVar(interp, (CONST char *) swig_variables[i].name,
TCL_TRACE_WRITES | TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *)
swig_variables[i].set, (ClientData) swig_variables[i].addr);


CONST is defined in tcl.h, so if you're version of tcl will define what
it does.

Regards,
Hans