3 ms·
GNU libc is an example of a relatively well known isxdigit() which uses a LUT even today. Its excuse is that this simplifies locale handling, you know for if y
by tialaramex 4y ago
GNU libc is an example of a relatively well known isxdigit() which uses a LUT even today.
Its excuse is that this simplifies locale handling, you know for if your locale has hexadecimal digits in a different place from everybody else, presumably because you're from some alternate universe where Z is a hex digit.
- litoE 4y agoBut isn't that just a bad implementation in libc, rather than a problem with C itself? It should be trivial to rewrite isxdigit() copying rust's algorithm in C.
- Gordonjcp 4y agoOr, you know, MIKBUG's implementation.
- torstenvl 4y agoThis is a problem with glibc (it's also a violation of the C standard, since isxdigit is explicitly not affected by the current locale). Other C libraries don't have this problem. http://git.musl-libc.org/cgit/musl/plain/src/ctype/isxdigit.c?id=6582baa752a8facb2c8a7b5b3dcf67331429cdc1 http://git.musl-libc.org/cgit/musl/plain/src/ctype/isxdigit....
- deleted 4y ago[deleted]