* lib/string.in.h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO instead of _GL_ARG_NONNULL in mbsncasecmp. This matches the spirit of N3322. lib/mbsncasecmp.c checks for n == 0 at the beginning of the function so null pointers are safe. --- ChangeLog | 8 ++++++++ lib/string.in.h | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog index dbeea0e345..c0d2445a3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2026-07-31 Lasse Collin <[email protected]> + + string-h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO in mbsncasecmp. + * lib/string.in.h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO instead of + _GL_ARG_NONNULL in mbsncasecmp. This matches the spirit of N3322. + lib/mbsncasecmp.c checks for n == 0 at the beginning of the function + so null pointers are safe. + 2026-07-31 Lasse Collin <[email protected]> string-h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO in mbsnlen. diff --git a/lib/string.in.h b/lib/string.in.h index 716d2471ee..d05d983cd3 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -1466,7 +1466,8 @@ _GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2) But beware that N is not a byte count but a character count! */ _GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n) _GL_ATTRIBUTE_PURE - _GL_ARG_NONNULL ((1, 2)); + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3); #endif #if @GNULIB_MBSPCASECMP@ -- 2.55.0
