On 07/03/2024 21:18, Jeff Davis wrote:
> Unicode case mapping tables and functions.
With -Wtype-limits, I'm seeing this warning:
unicode_case.c: In function ‘convert_case’:
unicode_case.c:107:47: warning: comparison of unsigned expression in ‘<
0’ is always false [-Wtype-limits]
107 | while (src[srcoff] != '\0' && (srclen < 0 || srcoff <
srclen))
| ^
That seems like legit issue. The comment in unicode_strlower/upper() says:
> * String src must be encoded in UTF-8. If srclen < 0, src must be
> * NUL-terminated.
But srclen is of type size_t, which is unsigned.
--
Heikki Linnakangas
Neon (https://neon.tech)