K
karl_m
I'm having trouble with unsigned long long declarations on my SCO unix
7.1.1 compiler. Can you test the following code? I'm expecting both
printf functions to report 1. Thanks, karl m
#include <stdio.h>
typedef struct {
unsigned long long cnt:16;
unsigned long long right:48;
} Page;
typedef struct {
Page *frame;
} Bt1;
typedef struct {
Page frame[1];
} Bt2;
char buff[4096];
int main (int argc, char **argv)
{
Bt1 bt1[1];
Bt2 bt2[1];
bt1->frame = (Page*)buff;
bt1->frame->cnt = 1;
bt1->frame->right = 30;
printf ("cnt1 = %d\n", bt1->frame->cnt);
bt2->frame->cnt = 1;
bt2->frame->right = 30;
printf ("cnt2 = %d\n", bt2->frame->cnt);
}
7.1.1 compiler. Can you test the following code? I'm expecting both
printf functions to report 1. Thanks, karl m
#include <stdio.h>
typedef struct {
unsigned long long cnt:16;
unsigned long long right:48;
} Page;
typedef struct {
Page *frame;
} Bt1;
typedef struct {
Page frame[1];
} Bt2;
char buff[4096];
int main (int argc, char **argv)
{
Bt1 bt1[1];
Bt2 bt2[1];
bt1->frame = (Page*)buff;
bt1->frame->cnt = 1;
bt1->frame->right = 30;
printf ("cnt1 = %d\n", bt1->frame->cnt);
bt2->frame->cnt = 1;
bt2->frame->right = 30;
printf ("cnt2 = %d\n", bt2->frame->cnt);
}