24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
if (!found_sz && sizeof(type) == sizeof(size_t)) \
found_sz = 1, sflag(type_sz, "unsigned " #type); \
if (!found_ofs && sizeof(type) == sizeof(ptrdiff_t)) \
found_ofs = 1, sflag(type_offset, "signed " #type); \
}
int main() {
int found_sz = 0, found_ofs = 0, found_type = 0;
iflag(arch_byte_bits,CHAR_BIT);
describe_integral(char,char);
describe_integral(short,short);
describe_integral(int,int);
describe_integral(long,long);
describe_integral(long long,llong);
printf("\n");
return 0;
}
|
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
if (!found_sz && sizeof(type) == sizeof(size_t)) \
found_sz = 1, sflag(type_sz, "unsigned " #type); \
if (!found_ofs && sizeof(type) == sizeof(ptrdiff_t)) \
found_ofs = 1, sflag(type_offset, "signed " #type); \
}
int main() {
unsigned char etest[sizeof(int)] = {0xFF,0x00};
if ((*(int*)etest) == 0xFF) sflag(prop_endian,"low");
else sflag(prop_endian,"high");
int found_sz = 0, found_ofs = 0, found_type = 0;
iflag(arch_byte_bits,CHAR_BIT);
describe_integral(char,char);
describe_integral(short,short);
describe_integral(int,int);
describe_integral(long,long);
describe_integral(long long,llong);
printf("\n");
return 0;
}
|