1. 12

  2. 3

    To be fair, despite taking int, the alnum etc. functions (ie. anything that indexes into __ctype_b_loc) are only defined for unsigned chars.

    The c argument is an int, the value of which the application shall ensure is representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.

    (See also: https://braincoke.fr/blog/2018/05/what-is-ctype-b-loc/#about-__ctype_b_loc )

    Of course, this makes them fairly worthless in our Unicode world. Even iswalnum is compiler dependent. Use ICU I guess.