1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
cat <<'EOF' > expected 8 4 4 EOF test_diff <<'EOF' int printf(); typedef struct { int x; int y; } S; typedef union { int a; char b; } U; typedef enum { RED, GREEN, BLUE } E; int main() { printf("%zu\n", sizeof(S)); printf("%zu\n", sizeof(U)); printf("%zu\n", sizeof(E)); } EOF