This is a two part question regarding pragma pointer_size and using 32-bit pointers in 64-bit code.
1. I am compiling a 64-bit application with the Intel c++ compiler for Itanium-based Windows apps. I use #pragma pointer_size to attempt to set the pointer size to 32-bit for a particular data structure. The compiler returns an "unrecognized pragma" error. Is this pragma valid for the Windows version of the compiler?
2. By using the __ptr 32 attribute in the pointer variable definitions, I can effect the result I am trying to get with #pragma pointer_size directive. However, I do not understand when a 64-bit app can legitimately use use a 32-bit pointer. Clearly it will does not work to typecast a pointer to a block memory allocated in a 64-bit app (using malloc or new) to a 32-bit pointer. The online documentation states
"This pragma and pointer modifier enable calling 32-bit functions from 64-bit processes. Use this pragma or pointer modifier to access legacy data from any 32-bit source."
How exactly? Because 32-bit dlls cannot exist in a 64-bit process, where exactly are these (valid) 32-bit pointers coming from?