Skip to content
Tcl Source Code History Of Ticket 1592791fffffffff
Login

History Of Ticket 1592791fffffffff

Artifacts Associated With Ticket 1592791fffffffff

  1. Ticket change [e4f3196d4a] (rid 88041) by das on 2006-11-08 17:25:27:

    1. assignee initialized to: "das"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Building 64bit tcl on LP64 platforms with gcc4 (and probably earlier) gives 
      many 'cast to/from pointer from/to integer of different size' warnings 
      about (safe) casts to/from ClientData and other void* types
      
      The recommended way to avoid these warnings is to add casts to the 
      intermediate types intptr_t/uintptr_t.
      
      The recently released autoconf 2.60 has AC_TYPE_INTPTR_T resp 
      AC_TYPE_UINTPTR_T macros  to check if these C99 types are available (if 
      an upgrade to autoconf 2.60 is not possible, it should be possible to write 
      equivalent macros for tcl.m4).
      
      The attached patch adds casts to (INTPTR_T) resp (UINTPTR_T) where 
      needed, those are macros in tclInt.h that fall back to void* if the intptr_t /
      uintptr_t types are not available.
      
      I have not touched the windows configure.in, 64bit win will thus fallback 
      as above and may still have those warnings, if so it is probably sufficient 
      to make the same changes as in unix/configure.in but I cannot test this.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "6"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "das"
    10. subsystem initialized to: "53. Configure and Build Tools"
    11. title initialized to: "Fix 64bit pointer cast warnings"
    12. type initialized to: "Patch"
  2. Ticket change [1133c555dd] (rid 95103) by das on 2006-11-09 00:26:54:

    1. icomment:
      
      
      File Added - 201945: tcl-1592791.diff
      
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  3. Ticket change [15b94cd407] (rid 124615) by das on 2006-11-09 00:39:43:

    1. icomment:
      
      
      File Deleted - 201945: 
      
      
      
      File Added - 201951: tcl-1592791.diff
      
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  4. Ticket change [19f0efee0e] (rid 122889) by das on 2006-11-09 00:40:43:

    1. icomment:
      
      
      File Added - 201952: tk-1592791.diff
      
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  5. Ticket change [8d22929ead] (rid 127876) by das on 2006-11-09 00:42:04:

    1. assignee changed to: "hobbs"
    2. icomment:
      Logged In: YES 
      user_id=90580
      
      Jeff,
      any objections to the autoconf 2.60 upgrade ?
      
      
    3. login: "das"
    4. mimetype: "text/plain"
    5. username: "das"
  6. Ticket change [ae2f4b1b17] (rid 101597) by hobbs on 2006-11-09 01:01:40:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Tcl is still stuck in pre-C89 code compatibility.  I believe
      the head should be able to move to C89, but /not/ C99, so
      lets keep that in mind for whatever changes are required.
      
      As far as the patching goes, I'd like to minimize the
      ugliness of these casts, and preferably give them some form
      that is clear in use, like the UCHAR() macro (something like
      UINT()).
      
      Otherwise I guess I'm ok with requiring ac 2.60 on the head,
      although I'll have to upgrade myself (only 2.59 on all my
      machines).
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  7. Ticket change [c3fb8b2f2d] (rid 111765) by das on 2006-11-09 01:49:10:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      while intptr_t/uintptr_t are C99isms, gcc makes them available in C89 mode as well; in any case, ac checks if they are 
      available in <inttypes.h> or <stdint.h>,  otherwise it finds a scalar type of the same size as s a pointer and defines 
      intptr_t/uintptr_t  to that. If this fails (and on win currently), my INTPTR_T/UINTPTR_T macros fall back to do a nop 
      cast to (void*).
      
      I agree about the ugliness, while standard, INTPTR_T is not a very nice name, but I couldn't come up with anything 
      memnonic to designate a cast to an integer type defined to be the same size as a pointer...
      
      I think UINT() would be confusing if you mean it to be just a cast to (intptr_t), but it might make sense for a cast of a 
      pointer to (int)(intptr_t). We would then also need a name for the other direction, i.e. cast of an int to (void*)(intptr_t), 
      as well as (unsigned int) variants of both, e.g. UINT(), UPTR(), UUINT(), UUPTR() ?
      not sure that's all that clear, maybe PTR2INT(), INT2PTR, PTR2UINT, UINT2PTR() ?
      
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  8. Ticket change [2c36b82bd8] (rid 118862) by dkf on 2006-11-09 18:13:38:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Please, no autoconf version changes. Or, if they have to
      change, we should go back to using autoconf 2.13 (since that
      produced much faster configure scripts) or 2.57 (which is
      the version I have. :-))
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  9. Ticket change [df0867624e] (rid 114953) by nijtmans on 2006-11-09 18:26:14:

    1. icomment:
      Logged In: YES 
      user_id=61031
      
      Suggestion: why not use an intermediate cast to size_t. This is a type that
      exists in C89 as well, and it works the same. No change to autoconf is
      needed.
      
      Regards,
              Jan Nijtmans
      
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  10. Ticket change [8940eafd38] (rid 131996) by das on 2006-11-09 19:04:02:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      Donal: it's a matter of 5 minutes to install a new version of autoconf, and it's trivial to have several versions installed 
      in parallel (I have 2.13, 2.52, 2.57, 2.59 and 2.60 here...), so I don't think that's a valid objection.
      In any case, returning to 2.13 is certainly not an option, it is broken in so many ways, and we use numerous ac 2.5x-
      only features in HEAD configure.in & tcl.m4 now; moreover, parity of HEAD's tcl.m4 with tclconfig/tcl.m4 needs to be 
      maintained (i.e. all TEA3 extension would have to go back to 2.13, which isn't going to happen).
      
      Jan: I'm don't think size_t would work, it is defined to be the type returned by sizeof, which does not need to be the 
      same size as that of a pointer (admittedly this would only happen on exotic platforms...)
      Also, in C89 there is no standard signed equivalent of size_t, and in pre-C89, size_t is not even guaranteed to be an 
      unsigned type... 
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  11. Ticket change [b6469abb32] (rid 125393) by das on 2006-11-09 19:37:47:

    1. icomment:
      
      
      File Added - 202079: tcl-1592791-INT2PTR.diff
      
      Logged In: YES 
      user_id=90580
      
      attached updated patch that uses PTR2INT(), INT2PTR(), PTR2UINT(), UINT2PTR() as proposed earlier.
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  12. Ticket change [fd9bf23689] (rid 108431) by dkf on 2006-11-09 20:14:16:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      "it's a matter of 5 minutes to install a new version of
      autoconf, and it's trivial to have several versions installed"
      
      Umm, not round here. Different local policies (and I don't
      want to do local admin when there are others to do that for
      me; why keep a dog and bark yourself?)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  13. Ticket change [4fbf3edc89] (rid 125879) by das on 2006-11-09 20:23:43:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      come on...
      $ curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
      $ tar zxf autoconf-2.60.tar.gz
      $ cd autoconf-2.60
      $ ./configure --prefix=$HOME/ac --program-suffix=-2.60
      $ make install
      $ ~/ac/bin/autoconf-2.60 --version
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  14. Ticket change [8bc152756c] (rid 127631) by das on 2006-11-10 11:16:27:

    1. icomment:
      
      
      File Deleted - 202079: 
      
      
      
      File Added - 202174: 1592791.diff
      
      Logged In: YES 
      user_id=90580
      
      attached revised patch that no longer depends on autoconf 2.60, instead it implements checks for intptr_t/uintptr_t 
      explicitly in configure.in.
      
      like the previous patch, uses PTR2INT(), INT2PTR(), PTR2UINT(), UINT2PTR() macros.
      
      if there are no further objections, I'll commit this tomorrow
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  15. Add attachment "1592791.diff" [f1156adaee] (rid 109302) by das on 2006-11-10 11:24:40.

  16. Ticket change [3e2471b359] (rid 121214) by das on 2006-11-10 11:24:40:

    1. icomment:
      
      
      File Deleted - 202174: 
      
      
      
      File Added - 202176: 1592791.diff
      
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  17. Ticket change [3d5bdf85de] (rid 121071) by das on 2006-11-13 15:23:30:

    1. closedate changed to: "2006-11-13T08:23:30"
    2. closer changed to: "das"
    3. icomment:
      Logged In: YES 
      user_id=90580
      
      committed to HEAD
      
      
    4. login: "das"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "das"
  18. Ticket change [7f19363b3a] (rid 97518) by das on 2006-11-13 16:05:14:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      verified that HEAD with this patch builds on all the available SF compilefarm hosts, i.e.
      alpha-linux1 amd64-linux1 openpower-linux1 sparc-solaris1 x86-freebsd1 x86-linux1 x86-linux2 x86-netbsd1 x86-
      openbsd1 x86-solaris1 
      as well as on macosx 10.4 (ppc, ppc64, i386 & x86_64), on macosx 10.3 (ppc) and macosx 10.2 (ppc)
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  19. Ticket change [bec39f86ed] (rid 102132) by das on 2006-11-13 16:16:50:

    1. assignee changed to: "das"
  20. Ticket change [213ae16d60] (rid 130547) by dgp on 2006-11-13 21:38:31:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Noise is much reduce on a 64-bit
      build, but I still see warnings
      from the following files:
      
      tclCompExpr.c
      tclEncoding.c
      tclEvent.c
      tclExecute.c
      tclHash.c
      tclIO.c
      tclProc.c
      tclTimer.c
      tclUtil.c
      tclUnixChan.c
      tclUnixPipe.c
      
      Here's the first set of warnings
      as an example:
      
      /local/src/tcl/unix/../generic/tclCompExpr.c: In function
      `TclCompileExpr':
      /local/src/tcl/unix/../generic/tclCompExpr.c:1249: warning:
      cast to pointer from integer of different size
      /local/src/tcl/unix/../generic/tclCompExpr.c: In function
      `CompileSubExpr':
      /local/src/tcl/unix/../generic/tclCompExpr.c:1390: warning:
      cast from pointer to integer of different size
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  21. Ticket change [b79d557c8a] (rid 125633) by das on 2006-11-14 05:14:49:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=90580
      
      Don,
      that is peculiar. I now get a warning-free 64-bit build on
      the platforms I have access to...
      
      tclCompExpr.c:1249 is
          Tcl_SetHashValue(hPtr, (ClientData) INT2PTR(i));
      i.e. it uses the new macro to cast the int i to (intpt_t)
      before casting to (void*), which should prevent the warning.
      Can you investigate why it still occurs on your platform?
      maybe the configure script does not detect intptr_t
      correctly? what are the values of the defines HAVE_INTPTR_T
      and intptr_t ?
      
      
    3. login: "das"
    4. mimetype: "text/plain"
    5. status changed to: "Open"
    6. username: "das"
  22. Ticket change [7ac0079aec] (rid 90383) by dgp on 2006-11-14 23:37:06:

    1. assignee changed to: "das"
    2. closedate changed to: "2006-11-14T16:37:06"
    3. closer changed to: "dgp"
    4. icomment:
      Logged In: YES 
      user_id=80530
      
      
      My compiler doesn't have (intptr_t),
      so in that case I shouldn't expect
      any warnings to be silenced?
      
      I guess I was just imagining that
      the build seemed quieter.
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. status changed to: "Closed"
    8. username: "dgp"
  23. Ticket change [39816d9929] (rid 112403) by das on 2006-11-16 07:11:42:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=90580
      Originator: YES
      
      Don,
      for compilers without intptr_t, the check below in configure.in is supposed to find an integer type as wide as a pointer and define intptr_t to that, can you investigate why this doesn't work for you, or send me the part of config.log showing what fails in that test ?
      
          AC_CACHE_CHECK([for pointer-size signed integer type], tcl_cv_intptr_t, [
          for tcl_cv_intptr_t in "int" "long" "long long" none; do
      if test "$tcl_cv_intptr_t" != none; then
          AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
          [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])], 
      [tcl_ok=yes], [tcl_ok=no])
          test "$tcl_ok" = yes && break; fi
          done])
          if test "$tcl_cv_intptr_t" != none; then
      AC_DEFINE_UNQUOTED([intptr_t], [$tcl_cv_intptr_t], [Signed integer
         type wide enough to hold a pointer.])
          fi
      
      
      
    3. login: "das"
    4. mimetype: "text/plain"
    5. status changed to: "Open"
    6. username: "das"
  24. Ticket change [62a5bbbcf2] (rid 92439) by dgp on 2006-11-16 21:23:33:

    1. assignee changed to: "das"
    2. closedate changed to: "2006-11-16T14:23:33"
    3. closer changed to: "dgp"
    4. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      Looks like I guessed wrong:
      
      checking for intptr_t... yes
      checking for uintptr_t... yes
      
      Can't reproduce today, so best 
      guess is I overlooked a `make distclean`
      when testing the first time.
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. status changed to: "Closed"
    8. username: "dgp"