diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-10-31 22:30:38 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-10-31 22:36:46 -0700 |
commit | 9f8a38414b12f4a2716763432271ec9c3b201604 (patch) | |
tree | 8aa1ec7f48e3b2349d2f6ff4a032973543df30e7 /src/copy.h | |
parent | 25e68323b9adcd7007258cc7b3c6986723b5a05b (diff) | |
download | coreutils-9f8a38414b12f4a2716763432271ec9c3b201604.tar.gz |
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.
Diffstat (limited to 'src/copy.h')
-rw-r--r-- | src/copy.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/copy.h b/src/copy.h index 68d52e1ce..47651f22d 100644 --- a/src/copy.h +++ b/src/copy.h @@ -289,23 +289,27 @@ int rpl_rename (char const *, char const *); bool copy (char const *src_name, char const *dst_name, bool nonexistent_dst, const struct cp_options *options, - bool *copy_into_self, bool *rename_succeeded); + bool *copy_into_self, bool *rename_succeeded) + _GL_ATTRIBUTE_NONNULL ((1, 2, 4, 5)); extern bool set_process_security_ctx (char const *src_name, char const *dst_name, mode_t mode, bool new_dst, - const struct cp_options *x); + const struct cp_options *x) + _GL_ATTRIBUTE_NONNULL (); extern bool set_file_security_ctx (char const *dst_name, - bool recurse, const struct cp_options *x); + bool recurse, const struct cp_options *x) + _GL_ATTRIBUTE_NONNULL (); -void dest_info_init (struct cp_options *); -void dest_info_free (struct cp_options *); -void src_info_init (struct cp_options *); -void src_info_free (struct cp_options *); +void dest_info_init (struct cp_options *) _GL_ATTRIBUTE_NONNULL (); +void dest_info_free (struct cp_options *) _GL_ATTRIBUTE_NONNULL (); +void src_info_init (struct cp_options *) _GL_ATTRIBUTE_NONNULL (); +void src_info_free (struct cp_options *) _GL_ATTRIBUTE_NONNULL (); -void cp_options_default (struct cp_options *); -bool chown_failure_ok (struct cp_options const *) _GL_ATTRIBUTE_PURE; +void cp_options_default (struct cp_options *) _GL_ATTRIBUTE_NONNULL (); +bool chown_failure_ok (struct cp_options const *) + _GL_ATTRIBUTE_NONNULL () _GL_ATTRIBUTE_PURE; mode_t cached_umask (void); #endif |