maint: add function attributes to .h files
commit9f8a38414b12f4a2716763432271ec9c3b201604
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Nov 2021 05:30:38 +0000 (31 22:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Nov 2021 05:36:46 +0000 (31 22:36 -0700)
tree8aa1ec7f48e3b2349d2f6ff4a032973543df30e7
parent25e68323b9adcd7007258cc7b3c6986723b5a05b
maint: add function attributes to .h files

Add _GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_MALLOC,
_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DALLOC_FREE,
_GL_ATTRIBUTE_RETURNS_NONNULL to .h files when appropriate.
* gl/lib/mbsalign.h, gl/lib/randperm.h, src/chown-core.h:
Include stdlib.h, for the benefit of _GL_ATTRIBUTE_DALLOC_FREE.
* gl/lib/randread.c (randread_free_body): New static function.
(randread_new, randread_free): Use it.
* src/copy.c (valid_options): Remove assert that is no longer
needed because it is now checked statically.
25 files changed:
gl/lib/cl-strtod.h
gl/lib/fd-reopen.h
gl/lib/heap.h
gl/lib/mbsalign.h
gl/lib/rand-isaac.h
gl/lib/randint.h
gl/lib/randperm.h
gl/lib/randread.c
gl/lib/randread.h
gl/lib/root-dev-ino.h
gl/lib/strnumcmp.h
gl/lib/xdectoint.h
gl/lib/xfts.h
src/blake2/b2sum.h
src/blake2/blake2.h
src/chown-core.h
src/cksum.h
src/copy.c
src/copy.h
src/cp-hash.h
src/expand-common.h
src/find-mount-point.h
src/force-link.h
src/operand2sig.h
src/prog-fprintf.h