]> Savannah Git Hosting - gnulib.git/commit
Make use of gcc's __nonnull_if_nonzero__ attribute.
authorBruno Haible <bruno@clisp.org>
Sun, 27 Apr 2025 21:36:52 +0000 (23:36 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 27 Apr 2025 21:42:32 +0000 (23:42 +0200)
commit03600605ad3eab5b1a74606498680b013fb89fe3
tree5febf970a8235bc5166975e59eb140f45da2703f
parent7e5c4efba12a1000efa30e7744428b9794c07e7b
Make use of gcc's __nonnull_if_nonzero__ attribute.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define
_GL_ATTR_nonnull_if_nonzero and _GL_ATTRIBUTE_NONNULL_IF_NONZERO.
* lib/attribute.h (ATTRIBUTE_NONNULL_IF_NONZERO): new macro.
* lib/stdlib.in.h (_GL_ATTRIBUTE_NONNULL_IF_NONZERO): New macro.
(bsearch, qsort, qsort_r): Use it.
* lib/string.in.h (_GL_ATTRIBUTE_NONNULL_IF_NONZERO): New macro.
(memcpy, memccpy, memmove, strncpy, strndup, strncat, memcmp, strncmp,
memchr, memrchr, memset, memset_explicit): Use it.
* lib/wchar.in.h (_GL_ATTRIBUTE_NONNULL_IF_NONZERO): New macro.
(wmemcpy, wmemmove, wcsncpy, wcsncat, wmemcmp, wcsncmp, wmemchr,
wmemset): Use it.
* lib/string-desc.h (sd_new_addr): Use it.
ChangeLog
lib/attribute.h
lib/stdlib.in.h
lib/string-desc.h
lib/string.in.h
lib/wchar.in.h
m4/gnulib-common.m4