fork(1) download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3.  
  4. #define _packed __attribute__((packed))
  5.  
  6.  
  7. _packed struct
  8. {
  9. uint8_t x1;
  10. _packed int x2;
  11. _packed uint8_t x3[2];
  12. _packed int x4;
  13.  
  14. }byte_int;
  15.  
  16. int main(void) {
  17. printf("%p %p %p %p\n", &byte_int.x1, &byte_int.x2, &byte_int.x3, &byte_int.x4);
  18. printf("%u %u %u %u\n", (unsigned int)&byte_int.x1, (unsigned int)&byte_int.x2, (unsigned int)&byte_int.x3, (unsigned int)&byte_int.x4); // I know it is an UB just to show the op in dec - easier to spot the odd and the even addresses
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 4408KB
stdin
Standard input is empty
stdout
0x5575b25a8038 0x5575b25a8039 0x5575b25a803d 0x5575b25a803f
2992275512 2992275513 2992275517 2992275519