isascii(3) macros and casts

Alejandro Colomar alx@kernel.org
Wed Dec 11 16:45:53 GMT 2024


Hi Andreas,

On Wed, Dec 11, 2024 at 04:40:34PM +0100, Andreas Schwab wrote:
> That depends on the locale's charset.

Hmmm; true.  How about this?

#define my_isdigit(c)                                                 \
(                                                                     \
	isdigit(_Generic(c, char: (unsigned char) c, default: c))     \
)

Cheers,
Alex

-- 
<https://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20241211/70c33c10/attachment.sig>


More information about the Libc-alpha mailing list