Overview
| Artifact ID: | 3ed68ef5be75994ee21f96c491e43944ca15323a |
|---|---|
| Ticket: | 218520ffffffffffffffffffffffffffffffffff
pointers are not integers (Tcl code is non standard) - 64 bi |
| User & Date: | nobody on 2000-10-26 01:01:37 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 863 Bug Version: 8.0.3 SubmitDate: '1998-11-25' LastModified: '1999-10-21' Severity: MED Status: Released Submitter: pat ChangedBy: hobbs OS: All OSVersion: NA Machine: NA FixedDate: '1999-10-21' FixedInVersion: 8.2 ClosedDate: '2000-10-25' Date: Sun, 8 Nov 1998 21:35:49 -0800 (PST) To: [email protected] Cc: [email protected] Subject: pointers are not integers (Tcl code is non standard) From: [email protected] Status: O Tcl 8.0.3 Bug email: [email protected] Support: None Severity: 1 OperatingSystem: Other OperatingSystemVersion: NEC Super-UX R8.2, Cray Unicos 9.2 Synopsis: pointers are not integers (Tcl code is non standard) Comments: Can't compile and execute successfully on 64 bit systems. Many bugs can be cured by using #include <stddef.h> /* ANSI standard */ and casting to type ptrdiff_t I changed unix/configure.in to include: AC_CHECK_HEADER(stddef.h, tcl_ok=1, tcl_ok=0) if test $tcl_ok = 1; then AC_CHECK_TYPE(ptrdiff_t, int) else AC_DEFINE(NO_STDDEF_H) fi Changed many occurrences of pointer differences being treated as integer. e.g generic/regexp.c has in function regtail() if (OP(scan) == BACK) offset = scan - val; else offset = val - scan; which should be if (OP(scan) == BACK) offset = (ptr_diff_t)(scan - val); else offset = (ptrdiff_t)(val - scan); When an integer is 32 bits and an address is 40 bits, the original doesn't work. When a char * comprises a character offset followed by a word address, the subtraction is nonsense. Unresolved problems: What did the author(s) really mean in generic/tclCompile.c in the function int TclObjIndexForString() which attempts [ line 7032 ] to create an integer by objIndex = (int) Tcl_GetHashValue(hPtr); ?? How can this work if the ponter is 64 bits. Truncate and guess a value? :-( Cheers, Len Makin 4/16/99 - redman - the code described no longer exists (regexp.c) in 8.1. 8.1 tested on 64bit Solaris works fine. Whether or not to fix in 8.0.x is another question. -- This has been fixed for 8.1+, which is the current stable release. -- 10/21/1999 hobbs
- foundin changed to: "obsolete: 8.0.3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "10. Objects"
- title changed to:
pointers are not integers (Tcl code is non standard) - 64 bi
- type changed to: "Bug"