Be careful when using POINTER_32 values in code that may be compiled as 64-bit code. The compiler will sign-extend the pointer when it is assigned to a native pointer in 64-bit code, not zero-extend the pointer.
Be careful when using POINTER_64 values in code that may be compiled as 32-bit code. The compiler will sign-extend the pointer in 32-bit code, not zero-extend the pointer.
关于
zero-extend : 0扩展
sign-extend : 符号拓展
本文讨论了在不同位宽编译环境下使用特定指针类型时可能遇到的问题。在32位和64位编译中,POINTER_32与POINTER_64类型的指针在赋值给本地指针时,编译器会进行符号拓展而非零拓展。这可能导致意外的负值或不正确的地址处理。
317

被折叠的 条评论
为什么被折叠?



