Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 287b379db6e2d7803646f499e8f713e408ca4e66
Ticket: 1631017fffffffffffffffffffffffffffffffff
compat/memcmp.c uses ++ on void*
User & Date: rrh on 2007-01-09 00:37:46
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The file compat/memcmp.c uses ++ on void* pointers.  I believe that doing arithmetic on void* pointers is explicitly undefined in the C standard; it is an error to do so in C++.
    
    Perhaps it would be better to cast the void * pointers given as arguments to unsigned char * pointers, and then do arithmetic on those pointers; that way ++ almost surely increments by 1.
    
    I found this because the compiler I use issues a warning message for this construct, and then increments the void * pointer by 8 for each ++ operation; our compiler is likely doing the "wrong" thing relative to long-standing convention.
    
  4. foundin changed to: "obsolete: 8.4.14"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "rrh"
  10. subsystem changed to: "52. Portability Support"
  11. title changed to: "compat/memcmp.c uses ++ on void*"
  12. type changed to: "Bug"