diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2025-05-09 15:52:15 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2025-05-09 15:57:13 -0700 |
| commit | 1fef50d07b0a2c209b3f8b546bc8da7801dedd0a (patch) | |
| tree | 7107559c7418bb082c46821924adfd64576757ee | |
| parent | maint: fix Automake warning (diff) | |
| download | coreutils-1fef50d07b0a2c209b3f8b546bc8da7801dedd0a.tar.gz coreutils-1fef50d07b0a2c209b3f8b546bc8da7801dedd0a.zip | |
maint: use MAYBE_UNUSED more consistently
* src/basenc.c (no_required_padding):
* gl/lib/smack.h (smack_new_label_from_self)
(smack_set_label_for_self):
* src/cksum.c (output_crc):
* src/digest.c (md5_sum_stream, sha1_sum_stream)
(sha224_sum_stream, sha256_sum_stream, sha384_sum_stream)
(sha512_sum_stream, sm3_sum_stream, output_file):
* src/stat.c (print_statfs, print_stat):
* src/sum.c (output_bsd, output_sysv):
* src/timeout.c (chld):
Mark possibly-unused parameters with MAYBE_UNUSED.
| -rw-r--r-- | gl/lib/smack.h | 4 | ||||
| -rw-r--r-- | src/basenc.c | 2 | ||||
| -rw-r--r-- | src/cksum.c | 5 | ||||
| -rw-r--r-- | src/digest.c | 22 | ||||
| -rw-r--r-- | src/stat.c | 4 | ||||
| -rw-r--r-- | src/sum.c | 10 | ||||
| -rw-r--r-- | src/timeout.c | 2 |
7 files changed, 27 insertions, 22 deletions
diff --git a/gl/lib/smack.h b/gl/lib/smack.h index 99f7747aa..c503d0b79 100644 --- a/gl/lib/smack.h +++ b/gl/lib/smack.h @@ -21,13 +21,13 @@ # include <sys/smack.h> #else static inline ssize_t -smack_new_label_from_self (char **label) +smack_new_label_from_self (MAYBE_UNUSED char **label) { return -1; } static inline int -smack_set_label_for_self (char const *label) +smack_set_label_for_self (MAYBE_UNUSED char const *label) { return -1; } diff --git a/src/basenc.c b/src/basenc.c index de1070b44..3f550a71f 100644 --- a/src/basenc.c +++ b/src/basenc.c @@ -193,7 +193,7 @@ base64_required_padding (int len) #if BASE_TYPE == 42 static int -no_required_padding (int len) +no_required_padding (MAYBE_UNUSED int len) { return 0; } diff --git a/src/cksum.c b/src/cksum.c index 3381125bd..8711ffeb9 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -356,8 +356,9 @@ crc32b_sum_stream (FILE *stream, void *resstream, uintmax_t *reslen) If ARGS is true, also print the FILE name. */ void -output_crc (char const *file, int binary_file, void const *digest, bool raw, - bool tagged, unsigned char delim, bool args, uintmax_t length) +output_crc (char const *file, MAYBE_UNUSED int binary_file, + void const *digest, bool raw, MAYBE_UNUSED bool tagged, + unsigned char delim, bool args, uintmax_t length) { if (raw) { diff --git a/src/digest.c b/src/digest.c index 1f65c73b4..302739e9f 100644 --- a/src/digest.c +++ b/src/digest.c @@ -245,32 +245,36 @@ static digest_output_fn sum_output_fns[]= #if HASH_ALGO_CKSUM static int -md5_sum_stream (FILE *stream, void *resstream, uintmax_t *length) +md5_sum_stream (FILE *stream, void *resstream, MAYBE_UNUSED uintmax_t *length) { return md5_stream (stream, resstream); } static int -sha1_sum_stream (FILE *stream, void *resstream, uintmax_t *length) +sha1_sum_stream (FILE *stream, void *resstream, MAYBE_UNUSED uintmax_t *length) { return sha1_stream (stream, resstream); } static int -sha224_sum_stream (FILE *stream, void *resstream, uintmax_t *length) +sha224_sum_stream (FILE *stream, void *resstream, + MAYBE_UNUSED uintmax_t *length) { return sha224_stream (stream, resstream); } static int -sha256_sum_stream (FILE *stream, void *resstream, uintmax_t *length) +sha256_sum_stream (FILE *stream, void *resstream, + MAYBE_UNUSED uintmax_t *length) { return sha256_stream (stream, resstream); } static int -sha384_sum_stream (FILE *stream, void *resstream, uintmax_t *length) +sha384_sum_stream (FILE *stream, void *resstream, + MAYBE_UNUSED uintmax_t *length) { return sha384_stream (stream, resstream); } static int -sha512_sum_stream (FILE *stream, void *resstream, uintmax_t *length) +sha512_sum_stream (FILE *stream, void *resstream, + MAYBE_UNUSED uintmax_t *length) { return sha512_stream (stream, resstream); } @@ -280,7 +284,7 @@ blake2b_sum_stream (FILE *stream, void *resstream, uintmax_t *length) return blake2b_stream (stream, resstream, *length); } static int -sm3_sum_stream (FILE *stream, void *resstream, uintmax_t *length) +sm3_sum_stream (FILE *stream, void *resstream, MAYBE_UNUSED uintmax_t *length) { return sm3_stream (stream, resstream); } @@ -1037,8 +1041,8 @@ digest_file (char const *filename, int *binary, unsigned char *bin_result, #if !HASH_ALGO_SUM static void output_file (char const *file, int binary_file, void const *digest, - bool raw, bool tagged, unsigned char delim, MAYBE_UNUSED bool args, - MAYBE_UNUSED uintmax_t length) + MAYBE_UNUSED bool raw, bool tagged, unsigned char delim, + MAYBE_UNUSED bool args, MAYBE_UNUSED uintmax_t length) { # if HASH_ALGO_CKSUM if (raw) diff --git a/src/stat.c b/src/stat.c index 3ea7da7f5..df9e3d440 100644 --- a/src/stat.c +++ b/src/stat.c @@ -857,7 +857,7 @@ out_file_context (char *pformat, size_t prefix_len, char const *filename) NODISCARD static bool print_statfs (char *pformat, size_t prefix_len, MAYBE_UNUSED char mod, char m, - int fd, char const *filename, + MAYBE_UNUSED int fd, char const *filename, void const *data) { STRUCT_STATVFS const *statfsbuf = data; @@ -1501,7 +1501,7 @@ unsigned_file_size (off_t size) /* Print stat info. Return zero upon success, nonzero upon failure. */ static bool print_stat (char *pformat, size_t prefix_len, char mod, char m, - int fd, char const *filename, void const *data) + MAYBE_UNUSED int fd, char const *filename, void const *data) { struct print_args *parg = (struct print_args *) data; struct stat *statbuf = parg->st; @@ -184,8 +184,8 @@ cleanup_buffer: If ARGS is true, also print the FILE name. */ void -output_bsd (char const *file, int binary_file, void const *digest, - bool raw, bool tagged, unsigned char delim, bool args, +output_bsd (char const *file, MAYBE_UNUSED int binary_file, void const *digest, + bool raw, MAYBE_UNUSED bool tagged, unsigned char delim, bool args, uintmax_t length) { if (raw) @@ -209,9 +209,9 @@ output_bsd (char const *file, int binary_file, void const *digest, If ARGS is true, also print the FILE name. */ void -output_sysv (char const *file, int binary_file, void const *digest, - bool raw, bool tagged, unsigned char delim, bool args, - uintmax_t length) +output_sysv (char const *file, MAYBE_UNUSED int binary_file, + void const *digest, bool raw, MAYBE_UNUSED bool tagged, + unsigned char delim, bool args, uintmax_t length) { if (raw) { diff --git a/src/timeout.c b/src/timeout.c index e869b2533..a73dd3297 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -187,7 +187,7 @@ send_sig (pid_t where, int sig) /* Signal handler which is required for sigsuspend() to be interrupted whenever SIGCHLD is received. */ static void -chld (int sig) +chld (MAYBE_UNUSED int sig) { } |
