Spot the bug in the tagged union

from C structs, unions and enums
C23 (GCC 13.3.0) intermediate 4 min 1 issue to find

Find the line that breaks this tagged union before it is printed.

C
#include <stdio.h>

typedef enum { VALUE_COUNT, VALUE_RATIO } ValueKind;

typedef struct {
    ValueKind kind;
    union { int count; double ratio; } as;
} Value;

int main(void) {
    Value value = {VALUE_RATIO, {.ratio = 0.5}};
    value.kind = VALUE_COUNT;
    printf("%d\n", value.as.count);
    return 0;
}
Open in playground
Report an error