fork download
  1. #include <stdio.h>
  2.  
  3. typedef enum __attribute__((packed)) {
  4. STATE_IDLE = 0,
  5. STATE_RUN,
  6. } State_t;
  7.  
  8. typedef struct __attribute__((packed)) {
  9. State_t State;
  10. int CB;
  11. } App1;
  12.  
  13. typedef struct __attribute__((packed)) {
  14. int CB;
  15. State_t State;
  16. } App2;
  17.  
  18. int main() {
  19. printf("%zu, %zu\n", sizeof(App1), sizeof(App2));
  20. return 0;
  21. }
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
5, 5