Menu

#216 gcc compiler warnings

3.4
closed-fixed
5
2011-07-15
2011-07-09
No

When compiling the current rc with gcc 4.6 , I get two compiler warmings:

./generic/itcl_objects.c: In function ‘Itcl_CreateObject’:
./generic/itcl_objects.c:195:25: warning: passing argument 5 of ‘tclStubsPtr->tcl_TraceVar2’ from incompatible pointer type [enabled by default]
./generic/itcl_objects.c:195:25: note: expected ‘char * (*)(void *, struct Tcl_Interp *, char *, char *, int)’ but argument is of type ‘char * (*)(void *, struct Tcl_Interp *, const char *, const char *, int)’
./generic/itcl_parse.c: In function ‘Itcl_ParseInit’:
./generic/itcl_parse.c:147:9: warning: passing argument 3 of ‘tclIntStubsPtr->tcl_SetNamespaceResolvers’ from incompatible pointer type [enabled by default]
./generic/itcl_parse.c:147:9: note: expected ‘int (*)(struct Tcl_Interp *, char *, struct Tcl_Namespace *, int, struct Tcl_Var_ **)’ but argument is of type ‘int (*)(struct Tcl_Interp *, const char *, struct Tcl_Namespace *, int, struct Tcl_Var_ **)’

The reason is that the signatures of the functions Itcl_ClassVarResolver
and Itcl_ParseVarResolver don't match the signature expected by
Tcl_TraceVar2 resp Tcl_SetNamespaceResolvers

Here is the fix for that.

Discussion

  • Jan Nijtmans

    Jan Nijtmans - 2011-07-09

    proposed fix

     
  • Jan Nijtmans

    Jan Nijtmans - 2011-07-09
    • milestone: --> 3.4
    • assigned_to: wiede --> dgp
     
  • Jan Nijtmans

    Jan Nijtmans - 2011-07-09

    alternative (additional) fix

     
  • Jan Nijtmans

    Jan Nijtmans - 2011-07-09

    Alternative (additional) fix.

    In stead if fixing those 2 signatures, we could also
    stop compiling Itcl with -DUSE_NON_CONST.
    patch (itcl2.patch) attached.

    Either of those two patches fix the compiler
    warning. itcl.patch makes everything compile
    file with -DUSE_NON_CONST, itcl2.patch
    makes everything compile file without
    -DUSE_NON_CONST.

    You can even apply both patches, if
    you like. Then everything will compile
    file no matter what USE_NON_CONST
    is set to. Just apply what you think best.

    (I think I would apply itcl2.patch only:
    no-one will ever compile Itcl
    with -DUSE_NON_CONST
    if the Makefile does not have
    it already ....)

     
  • Don Porter

    Don Porter - 2011-07-11

    Does Itcl 3.4 even build against Tcl 8.3 ?
    Is it important that it continue to do so?

     
  • Don Porter

    Don Porter - 2011-07-11

    The branch of development now called "itcl-3-branch"
    in fossil has not been buildable against Tcl 8.3 since
    August of 2007. To me that's strong evidence there is
    no one left who needs it to build against Tcl 8.3.

    Assuming that is correct, the obvious right answer is to
    drop all the CONST shenanigans, since their only purpose
    is to maintain 8.3 support. Just update every interface to
    the CONST conventions of the 8.4 interface.

     
  • Don Porter

    Don Porter - 2011-07-11

    See the drop-pre-Tcl-8-4 branch for all the
    proposed changes to Itcl 3.4 .

     
  • Jan Nijtmans

    Jan Nijtmans - 2011-07-11

    @dgp: I don't mind about building againsy Tcl 8.3 (never tried it), so I can only agree with all
    those proposed additional changes. itcl2.patch was a first step in that direction, but
    changing all CONST84's to simply CONST would be the next step. +1

     
  • Don Porter

    Don Porter - 2011-07-15

    pre-8.4 Tcl support dropped from Itcl 3.4.1

     
  • Don Porter

    Don Porter - 2011-07-15
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB