Hi All
I get the following:
rumba-jj) cc/vers
VSI C x86-64 X7.4-843 (GEM 50XB9) on OpenVMS x86_64 V9.2-1
rumba-jj) ty test.c
#include <stdio.h>
#include <stdlib.h>
int main()
{
#pragma pointer_size 64
int* i = (int*) malloc( 80 );
#pragma pointer_size 32
int* i2 = (int*) malloc( 80 );
printf( "%u %u" , i , i2 );
return 0;
}
4-DEC-2023 10:47:22
rumba-jj) cc/point=32 test.c
rumba-jj) link test
rumba-jj) run test
27984 28096
rumba-jj) cc/point=64 test.c
rumba-jj) link test
rumba-jj) run test
2147508256 2147508368
Looks like the #pragma pointer_size is ignored. I get the same on IA64. What do I do wrong?
Jouk
C : #pragma pointer_size ignored???
-
- VSI Expert
- Contributor
- Posts: 18
- Joined: Thu Sep 14, 2023 1:26 am
- Reputation: 0
- Status: Offline
Re: C : #pragma pointer_size ignored???
Try this:joukj wrote: ↑Mon Dec 04, 2023 4:51 amHi All
I get the following:
rumba-jj) cc/vers
VSI C x86-64 X7.4-843 (GEM 50XB9) on OpenVMS x86_64 V9.2-1
rumba-jj) ty test.c
#include <stdio.h>
#include <stdlib.h>
int main()
{
#pragma pointer_size 64
int* i = (int*) malloc( 80 );
#pragma pointer_size 32
int* i2 = (int*) malloc( 80 );
printf( "%u %u" , i , i2 );
return 0;
}
Looks like the #pragma pointer_size is ignored. I get the same on IA64. What do I do wrong?
Code: Select all
#include <stdio.h>
#include <stdlib.h>
int main()
{
#pragma pointer_size 64
int* i = _malloc64( 80 );
#pragma pointer_size 32
int* i2 = _malloc32( 80 );
printf( "%u %u" , i , i2 );
return 0;
}
Re: C : #pragma pointer_size ignored???
Thanks, that helps