[Info-vax] DEC C 64/32 bit pointer conversion question
John E. Malmberg
wb8tyw at qsl.net_work
Thu Sep 12 09:45:04 EDT 2019
I have a case where a system service only has accepts a 32 bit pointer
in an item list.
When I am compiling with 64 bit pointers available and the value can be
referenced in a 32 bit pointer, I would like to just extract out the
lower 32 bits.
However on the test program I get:
#if __INITIAL_POINTER_SIZE == 64
# pragma pointer_size save
# pragma pointer_size 32
#endif
#ifndef VMS_PTR32_TYPEDEF
#define VMS_PTR32_TYPEDEF
typedef char * char_ptr32;
typedef unsigned long * long_ptr32;
typedef void * void_ptr32;
#endif
str32 = (char_ptr32)((unsigned long int)str_64 & 0xFFFFFFFF);
str64 = 2060834088 or 0x000000007ad5d528
str32 = -2147483536 or 0x80000070
Which of course does not work.
What am I doing wrong?
Regards,
-John
More information about the Info-vax
mailing list