Overview
| Artifact ID: | 287b379db6e2d7803646f499e8f713e408ca4e66 |
|---|---|
| Ticket: | 1631017fffffffffffffffffffffffffffffffff
compat/memcmp.c uses ++ on void* |
| User & Date: | rrh on 2007-01-09 00:37:46 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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.
- foundin changed to: "obsolete: 8.4.14"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "rrh"
- subsystem changed to: "52. Portability Support"
- title changed to: "compat/memcmp.c uses ++ on void*"
- type changed to: "Bug"