Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
AMD opteron 64
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Keith Thompson, post: 1690792"] Note that this (calling malloc() with no prototype) may happen to work on some systems even if sizeof(int) > sizeof(void*). For example, if int is 32 bits, void* is 64 bits, the value returned by malloc happens to have the 32 high-order bits all zero, the machine is little-endian (I think), and a few other unstated assumptions hold, you could accidentally extract a valid 64-bit pointer from what the compiler thinks is a 32-bit int result. This is, of course, deep in the realm of undefined behavior. "Happens to work" is actually a bad thing, because it can make it more difficult to detect bugs. (Hey, maybe we should start referring to this kind of thing as "HTW". 8-)}) [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
AMD opteron 64
Top