Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c3fb8b2f2d68ff24d4abd122632e76d00c902e74
Ticket: 1592791fffffffffffffffffffffffffffffffff
Fix 64bit pointer cast warnings
User & Date: das on 2006-11-09 01:49:10
Changes

  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"