[Starkit] Tclkit 8.4.11

Jean-Claude Wippler jcw at equi4.com
Tue Sep 6 19:19:54 CEST 2005


Hi Bob,

> Trying to run genkit on HP-UX 11.0, mk fails to compile.  Attached  
> is my
> listing, where the HP aCC compiler has a problem with yesterday's  
> version of
> mk4tcl.cpp.
>
> I tried building with g++ 3.2, which does not complain about  
> mk4tcl.cpp.
> But then building kitsh fails, because it tries to use aCC.

Thanks for the reports.  There seem to be some "const" issues as well.
Let's try to get rid of most of the warnings.

> RUN: make Mk4tcl.a
>
> aCC -c +DAportable -O -I../../../src/mk/unix/../include
> -I/scratch/bob/src/tcl/generic/generic -I/scratch/bob/src/tcl/generic
> ../../../src/mk/unix/../tcl/mk4tcl.cpp
> Warning 749: "../../../src/mk/unix/../tcl/mk4tcl.cpp", line 250 #  
> The cast
> from 'Tcl_Event *' to 'MkEvent *' is performed as a  
> 'reinterpret_cast'. This
> operation is non-portable and potentially unsafe.
>       MkEvent *me = (MkEvent*)evPtr;
>                     ^^^^^^^^^^
> Warning 749: "../../../src/mk/unix/../tcl/mk4tcl.cpp", line 262 #  
> The cast
> from 'Tcl_Event *' to 'MkEvent *' is performed as a  
> 'reinterpret_cast'. This
> operation is non-portable and potentially unsafe.
>       MkEvent* me = (MkEvent*) evPtr;
>                     ^^^^^^^^^^

These two could be avoided, but even then it's a bit of a hack, so  
I'll leave them as is for now.

> Warning 829: "../../../src/mk/unix/../tcl/mk4tcl.cpp", line 340 #  
> Implicit
> conversion of string literal to 'char *' is deprecated.
>       "mk",       /* Type name.                  */
>       ^^^^

This is caused by the following in tcl.h:

     typedef struct Tcl_ChannelType {
         char *typeName;

The "right" way to fix this is to insert a "const" in tcl.h, IMO.   
For now, I've added a cast as workaround.

> Warning 829: "../../../src/mk/unix/../tcl/mk4tcl.cpp", line 477 #  
> Implicit
> conversion of string literal to 'char *' is deprecated.
>           Tcl_SetResult(interp, "unsupported property type",  
> TCL_STATIC);
>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is tricky, since Tcl_SetResult does not take a const.  I've  
inserted casts in Mk4tcl.cpp to avoid the warnings (three times).

> Warning 829: "../../../src/mk/unix/../tcl/mk4tcl.cpp", line 1018 #  
> Implicit
> conversion of string literal to 'char *' is deprecated.
>       "mkProperty",       // name
>       ^^^^^^^^^^^^

Same comment as for Tcl_ChannelType:

     typedef struct Tcl_ObjType {
         char *name;

The "right" way to fix this is to insert a "const" in tcl.h, IMO.   
For now, I've added a cast as workaround (twice).

> Warning 829: "../../../src/mk/unix/../tcl/mk4tcl.cpp", line 1589 #  
> Implicit
> conversion of string literal to 'char *' is deprecated.
>                       tcl_GetIndexFromObj(objv[2], getCmds) >= 0;

Another const issues, fixed in mk4tcl.{h,cpp}

> Error 970: "../../../src/mk/unix/../tcl/mk4tcl.cpp", line 2631 #  
> The address
> of thread-specific object 'SelectCmd' cannot be used to initialize  
> static
> variables.
>         { &MkTcl::SelectCmd,  2, 0, "select path ?...?" },
>           ^^^^^^^^^^^^^^^^^
> Error 970: "../../../src/mk/unix/../tcl/mk4tcl.cpp", line 2632 #  
> The address
> of thread-specific object 'ChannelCmd' cannot be used to initialize  
> static
> variables.
>         { &MkTcl::ChannelCmd, 3, 4, "channel path prop ?mode?" },
>           ^^^^^^^^^^^^^^^^^^

Ouch.  These make no sense to me (and why *two* errors, there are 9  
identical cases!).  I've rewritten the C++ code to avoid static inits.

The other weird thing is that the warning indicates threading is  
enabled - I wonder what caused this...

> make: *** [mk4tcl.o] Error 2
>
> ERROR: child process exited abnormally
>     while executing
> "run make Mk4tcl.a"

Patches attached, could you try them?

To rebuild only MK, you can do "rm -rf build/*/mk" and then "sh  
genkit B".

-jcw


-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkfixes.diff
Type: application/octet-stream
Size: 4473 bytes
Desc: not available
Url : http://www.equi4.com/pipermail/starkit/attachments/20050906/4a4c55ea/mkfixes-0001.obj
-------------- next part --------------



More information about the Starkit mailing list