Menu

#2278 missing wideInt Tcl_ObjType

obsolete: 8.4.2
closed-fixed
5
2003-04-16
2003-04-01
Don Porter
No

When I build and use Tcl on a platform where
TCL_WIDE_INT_IS_LONG gets #define'd,
like my Linux/Alpha machine, the consequence
is that there is no Tcl_ObjType named "wideInt"
registered in that Tcl library.

This means that an extension writer cannot
reliably Tcl_ConvertToType either to or from
the "wideInt" type across platforms. Instead
extensions are required to do a rather complex
conditionalizing on TCL_WIDE_INT_IS_LONG.

Would be much nicer if the Tcl library always
defined the "wideInt" Tcl_ObjType, but just
made sure it did the right thing on different
platforms.

The most recent example is the TIP 111
implementation. I cannot test this on my
Linux/Alpha box, because parts of it just
assume that comparisons against &tclWideIntType
are possible. That's the internal version of
the exported description above.

Discussion

  • Don Porter

    Don Porter - 2003-04-02

    Logged In: YES
    user_id=80530

    work in progress towards a proposed fix.

     
  • Don Porter

    Don Porter - 2003-04-02

    Logged In: YES
    user_id=80530

    updated patch. please review.

     
  • Don Porter

    Don Porter - 2003-04-05
    • priority: 5 --> 7
     
  • Don Porter

    Don Porter - 2003-04-05

    Logged In: YES
    user_id=80530

    Raising priority. This is no longer
    a theoretical problem for extension
    authors. Now the HEAD will not build.

     
  • Donal K. Fellows

    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2003-04-07
    • status: closed-fixed --> open-fixed
     
  • Don Porter

    Don Porter - 2003-04-07

    Logged In: YES
    user_id=80530

    re-opened. There's a problem with the
    committed fix.

    Although the "wideInt" type is now recognized,
    on TCL_WIDE_INT_IS_LONG platforms, it
    cannot be converted to.

    Tcl_ConvertToType(interp, objPtr, Tcl_GetObjType("wideInt"))

    wil convert objPtr to type "int" instead of the
    requested type "wideInt".

    The patch already attached here does not
    suffer from that defect.

     
  • Don Porter

    Don Porter - 2003-04-07
    • priority: 7 --> 5
     
  • Don Porter

    Don Porter - 2003-04-07
     
  • Don Porter

    Don Porter - 2003-04-07

    Logged In: YES
    user_id=80530

    here's an updated patch made
    against the current HEAD.

    Dropped priority since the
    HEAD compiles now.

     
  • Don Porter

    Don Porter - 2003-04-16
    • assigned_to: dkf --> dgp
    • status: open-fixed --> closed-fixed
     
  • Don Porter

    Don Porter - 2003-04-16

    Logged In: YES
    user_id=80530

    Fixed in 8.4 branch and HEAD.