Because it is allowed. The C99 standard only talks about isdigit , isalpha , etc.:
The functions in this subclause return a nonzero value (true) if and only if the value of argument c matches the description of the function.
As for what happens in practice, I'm not sure. By assumption, it uses a lookup table shared by all is* functions and masks everything except for a specific bit position. eg:.
static const int table[256] = { ... }; // ... etc ... int isalpha(char c) { return table[c] & 1024; } int isdigit(char c) { return table[c] & 2048; } // ... etc ...
source share