diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/blake2/b2sum.h | 3 | ||||
| -rw-r--r-- | src/blake2/blake2.h | 3 | ||||
| -rw-r--r-- | src/chown-core.h | 12 | ||||
| -rw-r--r-- | src/cksum.h | 3 | ||||
| -rw-r--r-- | src/copy.c | 1 | ||||
| -rw-r--r-- | src/copy.h | 22 | ||||
| -rw-r--r-- | src/cp-hash.h | 3 | ||||
| -rw-r--r-- | src/expand-common.h | 7 | ||||
| -rw-r--r-- | src/find-mount-point.h | 2 | ||||
| -rw-r--r-- | src/force-link.h | 6 | ||||
| -rw-r--r-- | src/operand2sig.h | 3 | ||||
| -rw-r--r-- | src/prog-fprintf.h | 2 |
12 files changed, 42 insertions, 25 deletions
diff --git a/src/blake2/b2sum.h b/src/blake2/b2sum.h index acf6ddc79..6517b258e 100644 --- a/src/blake2/b2sum.h +++ b/src/blake2/b2sum.h @@ -13,7 +13,8 @@ https://blake2.net. */ -int blake2b_stream( FILE *stream, void *resstream, size_t outbytes ); +int blake2b_stream (FILE *stream, void *resstream, size_t outbytes) + _GL_ATTRIBUTE_NONNULL ((1)); typedef int ( *blake2fn )( FILE *, void *, size_t ); #define BLAKE2S_OUTBYTES 32 #define BLAKE2B_OUTBYTES 64 diff --git a/src/blake2/blake2.h b/src/blake2/blake2.h index dc4672d1d..e56879ac2 100644 --- a/src/blake2/blake2.h +++ b/src/blake2/blake2.h @@ -152,7 +152,8 @@ extern "C" { int blake2b_init( blake2b_state *S, size_t outlen ); int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ); - int blake2b_init_param( blake2b_state *S, const blake2b_param *P ); + int blake2b_init_param (blake2b_state *S, const blake2b_param *P) + _GL_ATTRIBUTE_NONNULL (); int blake2b_update( blake2b_state *S, const void *in, size_t inlen ); int blake2b_final( blake2b_state *S, void *out, size_t outlen ); diff --git a/src/chown-core.h b/src/chown-core.h index 024e717ed..bd5d37b01 100644 --- a/src/chown-core.h +++ b/src/chown-core.h @@ -19,6 +19,7 @@ # define CHOWN_CORE_H # include "dev-ino.h" +# include <stdlib.h> enum Change_status { @@ -72,15 +73,20 @@ void chopt_free (struct Chown_option *); char * -gid_to_name (gid_t) _GL_ATTRIBUTE_MALLOC; +gid_to_name (gid_t) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE + _GL_ATTRIBUTE_RETURNS_NONNULL; char * -uid_to_name (uid_t) _GL_ATTRIBUTE_MALLOC; +uid_to_name (uid_t) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE + _GL_ATTRIBUTE_RETURNS_NONNULL; bool chown_files (char **files, int bit_flags, uid_t uid, gid_t gid, uid_t required_uid, gid_t required_gid, - struct Chown_option const *chopt); + struct Chown_option const *chopt) + _GL_ATTRIBUTE_NONNULL (); #endif /* CHOWN_CORE_H */ diff --git a/src/cksum.h b/src/cksum.h index 6310c7109..8e9be4439 100644 --- a/src/cksum.h +++ b/src/cksum.h @@ -9,7 +9,8 @@ crc_sum_stream (FILE *stream, void *resstream, uintmax_t *length); extern void output_crc (char const *file, int binary_file, void const *digest, bool tagged, unsigned char delim, bool args _GL_UNUSED, - uintmax_t length _GL_UNUSED); + uintmax_t length _GL_UNUSED) + _GL_ATTRIBUTE_NONNULL ((3)); extern bool cksum_pclmul (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out); diff --git a/src/copy.c b/src/copy.c index 3704e129e..f88bf3ed3 100644 --- a/src/copy.c +++ b/src/copy.c @@ -3071,7 +3071,6 @@ ATTRIBUTE_PURE static bool valid_options (const struct cp_options *co) { - assert (co != NULL); assert (VALID_BACKUP_TYPE (co->backup_type)); assert (VALID_SPARSE_MODE (co->sparse_mode)); assert (VALID_REFLINK_MODE (co->reflink_mode)); 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 diff --git a/src/cp-hash.h b/src/cp-hash.h index afd9d780a..72870fa6d 100644 --- a/src/cp-hash.h +++ b/src/cp-hash.h @@ -1,5 +1,6 @@ void hash_init (void); void forget_all (void); void forget_created (ino_t ino, dev_t dev); -char *remember_copied (char const *node, ino_t ino, dev_t dev); +char *remember_copied (char const *node, ino_t ino, dev_t dev) + _GL_ATTRIBUTE_NONNULL (); char *src_to_dest_lookup (ino_t ino, dev_t dev); diff --git a/src/expand-common.h b/src/expand-common.h index ac812d0ed..dc149cf0d 100644 --- a/src/expand-common.h +++ b/src/expand-common.h @@ -32,12 +32,13 @@ add_tab_stop (uintmax_t tabval); /* Add the comma or blank separated list of tab stops STOPS to the list of tab stops. */ extern void -parse_tab_stops (char const *stops); +parse_tab_stops (char const *stops) _GL_ATTRIBUTE_NONNULL (); /* TODO: Document */ extern uintmax_t -get_next_tab_column (const uintmax_t column, size_t* tab_index, - bool* last_tab); +get_next_tab_column (const uintmax_t column, size_t *tab_index, + bool *last_tab) + _GL_ATTRIBUTE_NONNULL ((3)); /* Called after all command-line options have been parsed, sets the final tab-stops values */ diff --git a/src/find-mount-point.h b/src/find-mount-point.h index a1bbcdc92..2d850f611 100644 --- a/src/find-mount-point.h +++ b/src/find-mount-point.h @@ -17,4 +17,4 @@ #include <stdlib.h> extern char *find_mount_point (char const *, struct stat const *) - _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NONNULL (); diff --git a/src/force-link.h b/src/force-link.h index 595c93f1a..f05165836 100644 --- a/src/force-link.h +++ b/src/force-link.h @@ -1,2 +1,4 @@ -extern int force_linkat (int, char const *, int, char const *, int, bool, int); -extern int force_symlinkat (char const *, int, char const *, bool, int); +extern int force_linkat (int, char const *, int, char const *, int, bool, int) + _GL_ATTRIBUTE_NONNULL (); +extern int force_symlinkat (char const *, int, char const *, bool, int) + _GL_ATTRIBUTE_NONNULL (); diff --git a/src/operand2sig.h b/src/operand2sig.h index bb156f337..b65529089 100644 --- a/src/operand2sig.h +++ b/src/operand2sig.h @@ -15,4 +15,5 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ -extern int operand2sig (char const *operand, char *signame); +extern int operand2sig (char const *operand, char *signame) + _GL_ATTRIBUTE_NONNULL (); diff --git a/src/prog-fprintf.h b/src/prog-fprintf.h index d26334c8f..eb0f185e6 100644 --- a/src/prog-fprintf.h +++ b/src/prog-fprintf.h @@ -20,6 +20,6 @@ # include <stdio.h> extern void prog_fprintf (FILE *fp, char const *fmt, ...) - _GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3)); + _GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3)) _GL_ATTRIBUTE_NONNULL ((1, 2));; #endif |
