#pragma pointer_size and using 32-bit ptrs in 64-bit apps

#pragma pointer_size and using 32-bit ptrs in 64-bit apps

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?

Kristy Saunders
kristy@sftsrc.com

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi
As far as I know, this Pragma is not supported by Intel C++ Compiler. Could you please post the compiler version or any other online doc where there is mention of this Pragma supported by Intel compiler.

For your second question, please see if this URL is of any help to you -
http://vmsbox.cjb.net/docs/cxx/ugv64bit.htm#index_x_367

cp

Thanks, this does help. This is the documentation to which I was referring.

http://www.intel.com/cd/ids/developer/asmo-na/eng/17969.htm

Message Edited by intel.software.network.support on 12-09-2005 10:05 AM

This pragma "#pragma pointer_size" has not been supported for a long time. This document needs to be updated.

If you'd like to see this pragma to be supported, please file a feature request to Premier Support.

Thanks very much,
Jennifer

Leave a Comment

Please sign in to add a comment. Not a member? Join today