* lib/string.in.h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO instead of _GL_ARG_NONNULL in mbsnlen. This matches the spirit of N3322. mbsnlen(NULL, 0) results in NULL < NULL comparison in lib/mbsnlen.c, which is valid after N3322. --- ChangeLog | 8 ++++++++ lib/string.in.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog index 8f057a5fb7..dbeea0e345 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 mbsnlen. + * lib/string.in.h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO instead of + _GL_ARG_NONNULL in mbsnlen. This matches the spirit of N3322. + mbsnlen(NULL, 0) results in NULL < NULL comparison in lib/mbsnlen.c, + which is valid after N3322. + 2026-07-31 Lasse Collin <[email protected]> string-h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO in explicit_bzero. diff --git a/lib/string.in.h b/lib/string.in.h index 0d01995d0e..716d2471ee 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -1358,7 +1358,7 @@ _GL_CXXALIASWARN (mbslen); at STRING and ending at STRING + LEN. */ _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len) _GL_ATTRIBUTE_PURE - _GL_ARG_NONNULL ((1)); + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2); #endif #if @GNULIB_MBSCHR@ -- 2.55.0
