"Kaveh" == Kaveh R Ghazi <ghazi@caip.rutgers.edu> writes:
Kaveh> I've seen in various source code people define isdigit(c) to
Kaveh> (unsigned)(c) - '0' <= 9
Kaveh> I believe that even in the various dialects of EBCDIC, the
Kaveh> digits '0' to '9' are continuous and ascending. (And I don't
Kaveh> think we have any more EBCDIC targets anyway.) So I thought
Kaveh> perhaps it's okay to do this transformation inside GCC.
Kaveh> Just to confirm though, this doesn't hold up in the face of
Kaveh> locales, right? So maybe not...
If "isdigit" is defined to match a digit in the charset of the current
locale, then no -- what you describe wouldn't match Arabic digits, nor
Chinese/Japanese ones, never mind lesser known locales.