Inline function definitions for isdigit and isxdigit?

Paul Eggert eggert@cs.ucla.edu
Fri Sep 16 14:58:00 GMT 2016


On 09/16/2016 05:06 AM, Florian Weimer wrote:
> For isxdigit, C99 and C11 make a final determination that only '0' … 
> '9', 'a' … 'f' and 'A' … 'F' are hexadecimal digits.

In that case, POSIX cannot override this and say that there are other 
hexadecimal digits. The POSIX spec for isxdigit says "Any conflict 
between the requirements described here and the ISO C standard is 
unintentional. This volume of POSIX.1-2008 defers to the ISO C 
standard." So even if another part of POSIX allows more symbolic names 
in the xdigit character class and this would seem to contradict C99, 
this contradiction is unintentional and the xdigit character class must 
be as specified by C99.

Although glibc need not conform to the standards if there are good 
reasons not to, I don't see any such reasons here. Robustness and 
security concerns and efficiency all suggest that isxdigit can be 
implemented inline as you suggest.



More information about the Libc-alpha mailing list