Am 10.10.2026 um 10:01 schrieb Ramiro Aceves:
return (ispunct((unsigned char) uc) || /* Posix: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ */
uc == 0x002D || /* HYPHEN-MINUS */
uc == 0x058A || /* ARMENIAN HYPHEN */
That fixes the undefined behavior but is still wrong. The letter U+0121
"ġ" is classified as a punctuation sign because its lower 8 bits are a
punctuation sign. That's a wrong conclusion. Instead, the condition
should be:
(uc < 0x0080 && ispunct((unsigned char)uc)) || …
In that code, the cast to unsigned char is not strictly necessary
anymore, but I'd leave it there for static analyzers like lint(1).
Roland