isspace() works if the input is representable as unsigned char or equal to EOF.
getchar() reads the next character from stdin.
When getchar()!=EOF; are all getchar() returned values representable as unsigned char?
uintmax_t count_space = 0;
for (int c; (c = getchar()) != EOF; )
if (isspace(c))
++count_space;
May this code lead to the undefined behavior?