Debian Codegraph @

test cases/common/23 endian/prog.c

raw
1 #include<stdint.h>
2
3 int is_big_endian(void) {
4 uint32_t one = 1;
5 if(*((uint8_t*) &one) == 1)
6 return 0;
7 return 1;
8 }
9
10
11 int main(void) {
12 int is_be_check = is_big_endian();
13 int is_be;
14 #ifdef IS_BE
15 is_be = 1;
16 #else
17 is_be = 0;
18 #endif
19 if(is_be_check && is_be)
20 return 0;
21 if(!is_be_check && !is_be)
22 return 0;
23 return 1;
24 }