]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Fix build failure on hosts with gcc 10
authorChen Qi <Qi.Chen@windriver.com>
Wed, 11 Feb 2026 05:17:04 +0000 (05:17 +0000)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Mon, 2 Mar 2026 13:38:57 +0000 (14:38 +0100)
We cannot just uname these unused parameters because gcc 10
need them. There will be error like below with gcc 10:

  lib/copydir.c:103:11: error: parameter name omitted

The Debian bullseye uses gcc 10 by default.

Most of the changes are done manually. Some changes in tests/unit
are done via the following shell command:
sed -i -e 's#void \*\*#MAYBE_UNUSED void \*\* _1#g'  tests/unit/test_*.c

Closes: <https://github.com/shadow-maint/shadow/issues/1530>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
22 files changed:
lib/copydir.c
lib/loginprompt.c
lib/pam_pass_non_interactive.c
lib/semanage.c
lib/sssd.h
src/chsh.c
src/gpasswd.c
src/grpconv.c
src/grpunconv.c
src/login.c
src/su.c
src/sulogin.c
tests/unit/test_adds.c
tests/unit/test_atoi_strtoi.c
tests/unit/test_chkhash.c
tests/unit/test_chkname.c
tests/unit/test_exit_if_null.c
tests/unit/test_logind.c
tests/unit/test_snprintf.c
tests/unit/test_strncpy.c
tests/unit/test_strtcpy.c
tests/unit/test_typetraits.c

index 058a79221bb0d41329db10f30784be3c3877288b..07c2cdd848eeb5ebdba510d73e1c4f9bc8090b32 100644 (file)
@@ -91,7 +91,7 @@ static int fchown_if_needed (int fdst, const struct stat *statp,
  */
 format_attr(printf, 2, 3)
 static void
-error_acl(struct error_context *, const char *fmt, ...)
+error_acl(MAYBE_UNUSED struct error_context *_1, const char *fmt, ...)
 {
        va_list ap;
 
index 18b899f5dda6d1b2bac0ad1ca800f2cb04b08948..8c419dbbe2252a7410a33d3e4370d89cb02d2893 100644 (file)
@@ -27,7 +27,7 @@
 
 
 static void
-login_exit(int)
+login_exit(MAYBE_UNUSED int _1)
 {
        _exit (EXIT_FAILURE);
 }
index 054077f392db9fe23e8c1ed0a326cd219a1f2f1d..672bb95af1977873508dc668fde3c90f5d6c980b 100644 (file)
@@ -27,7 +27,7 @@
 static int ni_conv (int num_msg,
                     const struct pam_message **msg,
                     struct pam_response **resp,
-                    void *);
+                    MAYBE_UNUSED void *_1);
 static const struct pam_conv non_interactive_pam_conv = {
        ni_conv,
        NULL
@@ -38,7 +38,7 @@ static const struct pam_conv non_interactive_pam_conv = {
 static int ni_conv (int num_msg,
                     const struct pam_message **msg,
                     struct pam_response **resp,
-                    void *)
+                    MAYBE_UNUSED void *_1)
 {
        struct pam_response *responses;
        int count;
index 0018536be692e13b921055ecfd43f52ca65095fc..1653e7710c29c6610dfcc5a59a2d34cb013bfddc 100644 (file)
@@ -28,7 +28,7 @@
 
 
 format_attr(printf, 3, 4)
-static void semanage_error_callback (void *,
+static void semanage_error_callback(MAYBE_UNUSED void *_1,
                                      semanage_handle_t *handle,
                                      const char *fmt, ...)
 {
index 1f7ff3ccc6ad95a1aca3b37e905227e619a0bf56..e99ccb3cc386533a17b43748088339321a0db122 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _SSSD_H_
 #define _SSSD_H_
 
+#include "attr.h"
+
 #define SSSD_DB_PASSWD 0x001
 #define SSSD_DB_GROUP  0x002
 
@@ -11,7 +13,7 @@
 extern int sssd_flush_cache (int dbflags);
 #else
 static inline int
-sssd_flush_cache(int)
+sssd_flush_cache(MAYBE_UNUSED int _1)
 {
        return 0;
 }
index f1b41e822533c2c29aea6869981ba2331b02254e..fafa9759d655b0fb396ed7320ab14c176f2f50c2 100644 (file)
@@ -198,7 +198,7 @@ static bool shell_is_listed (const char *sh, bool process_selinux)
 
 #else /* without HAVE_VENDORDIR */
 
-static bool shell_is_listed (const char *sh, bool)
+static bool shell_is_listed (const char *sh, MAYBE_UNUSED bool _1)
 {
        bool found = false;
        char *cp;
index f841ede868fc0b3a275e298c46d0cf63845b9684..6ffbc100921a737e8a9cfc88ffac454a175923e9 100644 (file)
@@ -109,14 +109,14 @@ static void update_group (struct group *gr);
 static void change_passwd (struct group *gr);
 #endif
 static void log_gpasswd_failure (const char *suffix);
-static void log_gpasswd_failure_system (/*@null@*/void *);
-static void log_gpasswd_failure_group (/*@null@*/void *);
+static void log_gpasswd_failure_system (/*@null@*/MAYBE_UNUSED void *_1);
+static void log_gpasswd_failure_group (/*@null@*/MAYBE_UNUSED void *_1);
 #ifdef SHADOWGRP
-static void log_gpasswd_failure_gshadow (/*@null@*/void *);
+static void log_gpasswd_failure_gshadow (/*@null@*/MAYBE_UNUSED void *_1);
 #endif
 static void log_gpasswd_success (const char *suffix);
-static void log_gpasswd_success_system (/*@null@*/void *);
-static void log_gpasswd_success_group(/*@null@*/void *);
+static void log_gpasswd_success_system (/*@null@*/MAYBE_UNUSED void *_1);
+static void log_gpasswd_success_group (/*@null@*/MAYBE_UNUSED void *_1);
 
 /*
  * usage - display usage message
@@ -467,13 +467,13 @@ static void log_gpasswd_failure (const char *suffix)
 }
 
 static void
-log_gpasswd_failure_system(void *)
+log_gpasswd_failure_system(MAYBE_UNUSED void *_1)
 {
        log_gpasswd_failure ("");
 }
 
 static void
-log_gpasswd_failure_group(void *)
+log_gpasswd_failure_group(MAYBE_UNUSED void *_1)
 {
        char  buf[1024];
 
@@ -483,7 +483,7 @@ log_gpasswd_failure_group(void *)
 
 #ifdef SHADOWGRP
 static void
-log_gpasswd_failure_gshadow(void *)
+log_gpasswd_failure_gshadow(MAYBE_UNUSED void *_1)
 {
        char  buf[1024];
 
@@ -574,13 +574,13 @@ static void log_gpasswd_success (const char *suffix)
 }
 
 static void
-log_gpasswd_success_system(void *)
+log_gpasswd_success_system(MAYBE_UNUSED void *_1)
 {
        log_gpasswd_success ("");
 }
 
 static void
-log_gpasswd_success_group(void *)
+log_gpasswd_success_group(MAYBE_UNUSED void *_1)
 {
        char  buf[1024];
 
index a41a1a84296bb893be512b3ece64c0636f989580..840a8c2d04463126961275197fcae91c4c0fba42 100644 (file)
@@ -277,7 +277,7 @@ int main (int argc, char **argv)
 }
 #else                          /* !SHADOWGRP */
 int
-main(int, char **argv)
+main(MAYBE_UNUSED int _1, char **argv)
 {
        fprintf (stderr,
                 "%s: not configured for shadow group support.\n", argv[0]);
index cf5fa1bc97934bfbcbfd9142f23cc6c38b2f54de..8f17398fd5a81708a449c6a51e6d6d6077bd92c8 100644 (file)
@@ -239,7 +239,7 @@ int main (int argc, char **argv)
 }
 #else                          /* !SHADOWGRP */
 int
-main(int, char **argv)
+main(MAYBE_UNUSED int _1, char **argv)
 {
        fprintf (stderr,
                 "%s: not configured for shadow group support.\n", argv[0]);
index 57cd0fb695f2d2136785ff8df15b86bb8e41e32d..b5b82f3a339422978c76db248f2efa7c5badedd3 100644 (file)
@@ -367,13 +367,13 @@ static void init_env (void)
 }
 
 static void
-exit_handler(int)
+exit_handler(MAYBE_UNUSED int _1)
 {
        _exit (0);
 }
 
 static void
-alarm_handler(int)
+alarm_handler(MAYBE_UNUSED int _1)
 {
        write_full(STDERR_FILENO, tmsg, strlen(tmsg));
        signal(SIGALRM, exit_handler);
index 873af8ddf68f88645c7b77005d2a59ac65273d59..8f49ee6ecaa9830e21f64f99a15af0700e32c9fb 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -111,7 +111,7 @@ static void execve_shell (const char *shellname,
                           char *args[],
                           char *const envp[]);
 #ifdef USE_PAM
-static void kill_child(pid_t);
+static void kill_child(MAYBE_UNUSED pid_t _1);
 static void prepare_pam_close_session (void);
 static void set_timeout(int);
 #else                          /* !USE_PAM */
index 3089c02d2157dd79bc2cb6f10d25009c284465ae..3daee58b25ed41d068f79e4db0d1be85c21d3e93 100644 (file)
@@ -50,7 +50,7 @@ static int pw_entry(const char *name, struct passwd *pwent);
 
 
 static void
-catch_signals(int)
+catch_signals(MAYBE_UNUSED int _1)
 {
        _exit (1);
 }
index 913a179df99dccb256d700ee8184bcd934f566be..cdfe41da05d44dd81e0684c03d775fb3eb8b5cf7 100644 (file)
 #include <cmocka.h>
 
 #include "adds.h"
+#include "attr.h"
 
-
-static void test_addsl_2_ok(void **);
-static void test_addsl_2_underflow(void **);
-static void test_addsl_2_overflow(void **);
-static void test_addsl_3_ok(void **);
-static void test_addsl_3_underflow(void **);
-static void test_addsl_3_overflow(void **);
-static void test_addsl_5_ok(void **);
+static void test_addsl_2_ok(MAYBE_UNUSED void ** _1);
+static void test_addsl_2_underflow(MAYBE_UNUSED void ** _1);
+static void test_addsl_2_overflow(MAYBE_UNUSED void ** _1);
+static void test_addsl_3_ok(MAYBE_UNUSED void ** _1);
+static void test_addsl_3_underflow(MAYBE_UNUSED void ** _1);
+static void test_addsl_3_overflow(MAYBE_UNUSED void ** _1);
+static void test_addsl_5_ok(MAYBE_UNUSED void ** _1);
 
 
 int
@@ -40,7 +40,7 @@ main(void)
 
 
 static void
-test_addsl_2_ok(void **)
+test_addsl_2_ok(MAYBE_UNUSED void ** _1)
 {
        assert_true(addsl(1, 3)                 == 1 + 3);
        assert_true(addsl(-4321, 7)             == -4321 + 7);
@@ -54,7 +54,7 @@ test_addsl_2_ok(void **)
 
 
 static void
-test_addsl_2_underflow(void **)
+test_addsl_2_underflow(MAYBE_UNUSED void ** _1)
 {
        assert_true(addsl(LONG_MIN, -1)         == LONG_MIN);
        assert_true(addsl(LONG_MIN + 3, -7)     == LONG_MIN);
@@ -63,7 +63,7 @@ test_addsl_2_underflow(void **)
 
 
 static void
-test_addsl_2_overflow(void **)
+test_addsl_2_overflow(MAYBE_UNUSED void ** _1)
 {
        assert_true(addsl(LONG_MAX, 1)          == LONG_MAX);
        assert_true(addsl(LONG_MAX - 3, 7)      == LONG_MAX);
@@ -72,7 +72,7 @@ test_addsl_2_overflow(void **)
 
 
 static void
-test_addsl_3_ok(void **)
+test_addsl_3_ok(MAYBE_UNUSED void ** _1)
 {
        assert_true(addsl(1, 2, 3)              == 1 + 2 + 3);
        assert_true(addsl(LONG_MIN, -3, 4)      == LONG_MIN + 4 - 3);
@@ -82,7 +82,7 @@ test_addsl_3_ok(void **)
 
 
 static void
-test_addsl_3_underflow(void **)
+test_addsl_3_underflow(MAYBE_UNUSED void ** _1)
 {
        assert_true(addsl(LONG_MIN, 2, -3)      == LONG_MIN);
        assert_true(addsl(LONG_MIN, -1, 0)      == LONG_MIN);
@@ -90,7 +90,7 @@ test_addsl_3_underflow(void **)
 
 
 static void
-test_addsl_3_overflow(void **)
+test_addsl_3_overflow(MAYBE_UNUSED void ** _1)
 {
        assert_true(addsl(LONG_MAX, -1, 2)      == LONG_MAX);
        assert_true(addsl(LONG_MAX, +1, 0)      == LONG_MAX);
@@ -99,7 +99,7 @@ test_addsl_3_overflow(void **)
 
 
 static void
-test_addsl_5_ok(void **)
+test_addsl_5_ok(MAYBE_UNUSED void ** _1)
 {
        assert_true(addsl(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN, 44) == 42);
 }
index 3947745b0c87033536d5b2d3298be60b021c4b46..ceed5452d08568591fbcfd83f381d242ce33d0f1 100644 (file)
 
 #include "atoi/strtoi/strtoi.h"
 #include "atoi/strtoi/strtou_noneg.h"
+#include "attr.h"
 
-
-static void test_strtoi(void **);
-static void test_strtou(void **);
-static void test_strtou_noneg(void **);
+static void test_strtoi(MAYBE_UNUSED void ** _1);
+static void test_strtou(MAYBE_UNUSED void ** _1);
+static void test_strtou_noneg(MAYBE_UNUSED void ** _1);
 
 
 int
@@ -37,7 +37,7 @@ main(void)
 
 
 static void
-test_strtoi(void **)
+test_strtoi(MAYBE_UNUSED void ** _1)
 {
        int   status;
        char  *end;
@@ -78,7 +78,7 @@ test_strtoi(void **)
 
 
 static void
-test_strtou(void **)
+test_strtou(MAYBE_UNUSED void ** _1)
 {
        int   status;
        char  *end;
@@ -119,7 +119,7 @@ test_strtou(void **)
 
 
 static void
-test_strtou_noneg(void **)
+test_strtou_noneg(MAYBE_UNUSED void ** _1)
 {
        int   status;
        char  *end;
index 5f9249a551ad7b4e14a34aebc681cc0e0087c270..9b0c614b88d9f42fb33664ca5fb81749b3b82dcc 100644 (file)
 #include <cmocka.h>
 
 #include "chkhash.h"
-
+#include "attr.h"
 
 static void
-test_is_valid_hash_ok_yescrypt(void **)
+test_is_valid_hash_ok_yescrypt(MAYBE_UNUSED void ** _1)
 {
        // Basic yescrypt hash: $y$ + params + $ + salt + $ + 43 character hash
        assert_true(is_valid_hash("$y$j9T$salt$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ"));
@@ -45,7 +45,7 @@ test_is_valid_hash_ok_yescrypt(void **)
 
 
 static void
-test_is_valid_hash_ok_bcrypt(void **)
+test_is_valid_hash_ok_bcrypt(MAYBE_UNUSED void ** _1)
 {
        // Basic bcrypt hash: $2a$ + cost + $ + 53 character hash
        assert_true(is_valid_hash("$2a$12$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ."));
@@ -65,7 +65,7 @@ test_is_valid_hash_ok_bcrypt(void **)
 
 
 static void
-test_is_valid_hash_ok_sha512(void **)
+test_is_valid_hash_ok_sha512(MAYBE_UNUSED void ** _1)
 {
        // Basic SHA-512 hash: $6$ + salt + $ + 86 character hash
        assert_true(is_valid_hash("$6$salt$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890./abcdefghijklmnopqrstuv"));
@@ -88,7 +88,7 @@ test_is_valid_hash_ok_sha512(void **)
 
 
 static void
-test_is_valid_hash_ok_sha256(void **)
+test_is_valid_hash_ok_sha256(MAYBE_UNUSED void ** _1)
 {
        // Basic SHA-256 hash: $5$ + salt + $ + 43 character hash
        assert_true(is_valid_hash("$5$salt$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ"));
@@ -111,7 +111,7 @@ test_is_valid_hash_ok_sha256(void **)
 
 
 static void
-test_is_valid_hash_ok_md5(void **)
+test_is_valid_hash_ok_md5(MAYBE_UNUSED void ** _1)
 {
        // Basic MD5 hash: $1$ + salt + $ + 22 character hash
        assert_true(is_valid_hash("$1$salt$abcdefghijklmnopqrstuv"));
@@ -122,7 +122,7 @@ test_is_valid_hash_ok_md5(void **)
 
 
 static void
-test_is_valid_hash_ok_des(void **)
+test_is_valid_hash_ok_des(MAYBE_UNUSED void ** _1)
 {
        // Basic DES hash: 13 characters
        assert_true(is_valid_hash("abcDEF123./zZ"));
@@ -133,7 +133,7 @@ test_is_valid_hash_ok_des(void **)
 
 
 static void
-test_is_valid_hash_ok_special(void **)
+test_is_valid_hash_ok_special(MAYBE_UNUSED void ** _1)
 {
        // Empty string - passwordless account
        assert_true(is_valid_hash(""));
@@ -153,7 +153,7 @@ test_is_valid_hash_ok_special(void **)
 
 
 static void
-test_is_valid_hash_edge_salt_chars(void **)
+test_is_valid_hash_edge_salt_chars(MAYBE_UNUSED void ** _1)
 {
        // SHA-512 with backslash in salt
        assert_true(is_valid_hash("$6$sa\\lt$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890./abcdefghijklmnopqrstuv"));
@@ -170,7 +170,7 @@ test_is_valid_hash_edge_salt_chars(void **)
 
 
 static void
-test_is_valid_hash_edge_account_locks(void **)
+test_is_valid_hash_edge_account_locks(MAYBE_UNUSED void ** _1)
 {
        // Complex ! prefix scenarios with various hash types should work
        assert_true(is_valid_hash("!$2a$12$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ."));
@@ -184,7 +184,7 @@ test_is_valid_hash_edge_account_locks(void **)
 
 
 static void
-test_is_invalid_algorithm(void **)
+test_is_invalid_algorithm(MAYBE_UNUSED void ** _1)
 {
        assert_false(is_valid_hash("$7$salt$hash"));
        assert_false(is_valid_hash("$2z$12$hash"));
@@ -193,7 +193,7 @@ test_is_invalid_algorithm(void **)
 
 
 static void
-test_is_invalid_hash_length(void **)
+test_is_invalid_hash_length(MAYBE_UNUSED void ** _1)
 {
        assert_false(is_valid_hash("$y$j9T$salt$tooshort"));
        assert_false(is_valid_hash("$2a$12$tooshort"));
@@ -203,7 +203,7 @@ test_is_invalid_hash_length(void **)
 
 
 static void
-test_is_invalid_delimeters(void **)
+test_is_invalid_delimeters(MAYBE_UNUSED void ** _1)
 {
        // Missing delimiters
        assert_false(is_valid_hash("$6salt$hash"));
@@ -216,7 +216,7 @@ test_is_invalid_delimeters(void **)
 
 
 static void
-test_is_invalid_salt_chars(void **)
+test_is_invalid_salt_chars(MAYBE_UNUSED void ** _1)
 {
        assert_false(is_valid_hash("$6$sa:lt$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890./abcdefghijklmnopqrstuv"));
        assert_false(is_valid_hash("$6$sa$lt$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890./abcdefghijklmnopqrstuv"));
@@ -225,7 +225,7 @@ test_is_invalid_salt_chars(void **)
 
 
 static void
-test_is_invalid_rounds(void **)
+test_is_invalid_rounds(MAYBE_UNUSED void ** _1)
 {
        assert_false(is_valid_hash("$6$rounds=abc$salt$hash")); // Non-numeric rounds
        assert_false(is_valid_hash("$6$rounds=0$salt$hash")); // Invalid rounds (must start with 1-9)
index dfb04c9204dddfbdd93f99e66f6d628720651418..c76b211e5f0d47661b784271682281cd2b207a9d 100644 (file)
 
 #include "alloc/malloc.h"
 #include "chkname.h"
+#include "attr.h"
 
-
-static void test_is_valid_user_name_ok(void **);
-static void test_is_valid_user_name_ok_dollar(void **);
-static void test_is_valid_user_name_nok_dash(void **);
-static void test_is_valid_user_name_nok_dir(void **);
-static void test_is_valid_user_name_nok_dollar(void **);
-static void test_is_valid_user_name_nok_empty(void **);
-static void test_is_valid_user_name_nok_numeric(void **);
-static void test_is_valid_user_name_nok_otherchars(void **);
-static void test_is_valid_user_name_long(void **);
+static void test_is_valid_user_name_ok(MAYBE_UNUSED void ** _1);
+static void test_is_valid_user_name_ok_dollar(MAYBE_UNUSED void ** _1);
+static void test_is_valid_user_name_nok_dash(MAYBE_UNUSED void ** _1);
+static void test_is_valid_user_name_nok_dir(MAYBE_UNUSED void ** _1);
+static void test_is_valid_user_name_nok_dollar(MAYBE_UNUSED void ** _1);
+static void test_is_valid_user_name_nok_empty(MAYBE_UNUSED void ** _1);
+static void test_is_valid_user_name_nok_numeric(MAYBE_UNUSED void ** _1);
+static void test_is_valid_user_name_nok_otherchars(MAYBE_UNUSED void ** _1);
+static void test_is_valid_user_name_long(MAYBE_UNUSED void ** _1);
 
 
 int
@@ -51,7 +51,7 @@ main(void)
 
 
 static void
-test_is_valid_user_name_ok(void **)
+test_is_valid_user_name_ok(MAYBE_UNUSED void ** _1)
 {
        assert_true(is_valid_user_name("alx"));
        assert_true(is_valid_user_name("u-ser"));
@@ -66,7 +66,7 @@ test_is_valid_user_name_ok(void **)
 
 
 static void
-test_is_valid_user_name_ok_dollar(void **)
+test_is_valid_user_name_ok_dollar(MAYBE_UNUSED void ** _1)
 {
        // Non-POSIX extension for Samba 3.x "add machine script".
        assert_true(is_valid_user_name("dollar$"));
@@ -75,7 +75,7 @@ test_is_valid_user_name_ok_dollar(void **)
 
 
 static void
-test_is_valid_user_name_nok_dash(void **)
+test_is_valid_user_name_nok_dash(MAYBE_UNUSED void ** _1)
 {
        assert_true(false == is_valid_user_name("-"));
        assert_true(false == is_valid_user_name("-not-valid"));
@@ -84,7 +84,7 @@ test_is_valid_user_name_nok_dash(void **)
 
 
 static void
-test_is_valid_user_name_nok_dir(void **)
+test_is_valid_user_name_nok_dir(MAYBE_UNUSED void ** _1)
 {
        assert_true(false == is_valid_user_name("."));
        assert_true(false == is_valid_user_name(".."));
@@ -92,7 +92,7 @@ test_is_valid_user_name_nok_dir(void **)
 
 
 static void
-test_is_valid_user_name_nok_dollar(void **)
+test_is_valid_user_name_nok_dollar(MAYBE_UNUSED void ** _1)
 {
        assert_true(false == is_valid_user_name("$"));
        assert_true(false == is_valid_user_name("$dollar"));
@@ -103,14 +103,14 @@ test_is_valid_user_name_nok_dollar(void **)
 
 
 static void
-test_is_valid_user_name_nok_empty(void **)
+test_is_valid_user_name_nok_empty(MAYBE_UNUSED void ** _1)
 {
        assert_true(false == is_valid_user_name(""));
 }
 
 
 static void
-test_is_valid_user_name_nok_numeric(void **)
+test_is_valid_user_name_nok_numeric(MAYBE_UNUSED void ** _1)
 {
        assert_true(false == is_valid_user_name("6"));
        assert_true(false == is_valid_user_name("42"));
@@ -118,7 +118,7 @@ test_is_valid_user_name_nok_numeric(void **)
 
 
 static void
-test_is_valid_user_name_nok_otherchars(void **)
+test_is_valid_user_name_nok_otherchars(MAYBE_UNUSED void ** _1)
 {
        assert_true(false == is_valid_user_name("no spaces"));
        assert_true(false == is_valid_user_name("no,"));
@@ -128,7 +128,7 @@ test_is_valid_user_name_nok_otherchars(void **)
 
 
 static void
-test_is_valid_user_name_long(void **)
+test_is_valid_user_name_long(MAYBE_UNUSED void ** _1)
 {
        size_t  max;
        char    *name;
index 819239f502aebbd2fa3680be20e37cb67e40b1d6..28e285d3acfb97262ee618dfb60b3c468ed2690e 100644 (file)
@@ -16,7 +16,7 @@
 #include <cmocka.h>
 
 #include "sizeof.h"
-
+#include "attr.h"
 
 #define assert_unreachable()  assert_true(0)
 
 static jmp_buf  jmpb;
 
 
-void __wrap_exit(int);
+void __wrap_exit(MAYBE_UNUSED int _1);
 
-static void test_exit_if_null_exit(void **);
-static void test_exit_if_null_ok(void **);
+static void test_exit_if_null_exit(MAYBE_UNUSED void ** _1);
+static void test_exit_if_null_ok(MAYBE_UNUSED void ** _1);
 
 
 int
@@ -45,14 +45,14 @@ main(void)
 
 
 void
-__wrap_exit(int)
+__wrap_exit(MAYBE_UNUSED int _1)
 {
        longjmp(jmpb, EXIT_CALLED);
 }
 
 
 static void
-test_exit_if_null_exit(void **)
+test_exit_if_null_exit(MAYBE_UNUSED void ** _1)
 {
        char *volatile  p;
 
@@ -78,7 +78,7 @@ test_exit_if_null_exit(void **)
 
 
 static void
-test_exit_if_null_ok(void **)
+test_exit_if_null_ok(MAYBE_UNUSED void ** _1)
 {
        char  *p;
 
index 6cfc6d9119c40ceead436bb8109b17e2c1d62824..17986098a53a0a41764f5e7e1db8288091fa8dca 100644 (file)
 #include <sys/types.h>
 
 #include "prototypes.h"
+#include "attr.h"
 
 /***********************
  * WRAPPERS
  **********************/
 struct passwd *
-__wrap_prefix_getpwnam(uid_t)
+__wrap_prefix_getpwnam(MAYBE_UNUSED uid_t _1)
 {
     return (struct passwd*) mock();
 }
 
 int
-__wrap_sd_uid_get_sessions(uid_t, int, char ***)
+__wrap_sd_uid_get_sessions(MAYBE_UNUSED uid_t _1, MAYBE_UNUSED int _2, MAYBE_UNUSED char ***_3)
 {
     return mock();
 }
@@ -33,7 +34,7 @@ __wrap_sd_uid_get_sessions(uid_t, int, char ***)
 /***********************
  * TEST
  **********************/
-static void test_active_sessions_count_return_ok(void **)
+static void test_active_sessions_count_return_ok(MAYBE_UNUSED void ** _1)
 {
     int count;
     struct passwd *pw = malloc(sizeof(struct passwd));
@@ -46,7 +47,7 @@ static void test_active_sessions_count_return_ok(void **)
     assert_int_equal(count, 1);
 }
 
-static void test_active_sessions_count_prefix_getpwnam_failure(void **)
+static void test_active_sessions_count_prefix_getpwnam_failure(MAYBE_UNUSED void ** _1)
 {
     int count;
     struct passwd *pw = NULL;
index df778914324c27204da62389bbbc30c724891ba5..f082ef0f2a6fa5823d93b79d0b5d2eaa55c65a91 100644 (file)
 
 #include "sizeof.h"
 #include "string/sprintf/snprintf.h"
+#include "attr.h"
 
-
-static void test_stprintf_a_trunc(void **);
-static void test_stprintf_a_ok(void **);
+static void test_stprintf_a_trunc(MAYBE_UNUSED void ** _1);
+static void test_stprintf_a_ok(MAYBE_UNUSED void ** _1);
 
 
 int
@@ -34,7 +34,7 @@ main(void)
 
 
 static void
-test_stprintf_a_trunc(void **)
+test_stprintf_a_trunc(MAYBE_UNUSED void ** _1)
 {
        char  buf[countof("foo")];
 
@@ -48,7 +48,7 @@ test_stprintf_a_trunc(void **)
 
 
 static void
-test_stprintf_a_ok(void **)
+test_stprintf_a_ok(MAYBE_UNUSED void ** _1)
 {
        char  buf[countof("foo")];
 
index 3da043154ef848405cc5fb4e663469434e9a6180..e20a08d7201b594754cde26f2810244dfb0b38e9 100644 (file)
 
 #include "sizeof.h"
 #include "string/strcpy/strncpy.h"
+#include "attr.h"
 
-
-static void test_strncpy_a_trunc(void **);
-static void test_strncpy_a_fit(void **);
-static void test_strncpy_a_pad(void **);
+static void test_strncpy_a_trunc(MAYBE_UNUSED void ** _1);
+static void test_strncpy_a_fit(MAYBE_UNUSED void ** _1);
+static void test_strncpy_a_pad(MAYBE_UNUSED void ** _1);
 
 
 int
@@ -37,7 +37,7 @@ main(void)
 
 
 static void
-test_strncpy_a_trunc(void **)
+test_strncpy_a_trunc(MAYBE_UNUSED void ** _1)
 {
        char  buf[3];
 
@@ -52,7 +52,7 @@ test_strncpy_a_trunc(void **)
 
 
 static void
-test_strncpy_a_fit(void **)
+test_strncpy_a_fit(MAYBE_UNUSED void ** _1)
 {
        char  buf[3];
 
@@ -67,7 +67,7 @@ test_strncpy_a_fit(void **)
 
 
 static void
-test_strncpy_a_pad(void **)
+test_strncpy_a_pad(MAYBE_UNUSED void ** _1)
 {
        char  buf[3];
 
index e4ce1572d8f15cf40d731a935da378256f2f6695..41fced7f5dddce06acc17da0cf903f099857e48c 100644 (file)
 
 #include "sizeof.h"
 #include "string/strcpy/strtcpy.h"
+#include "attr.h"
 
-
-static void test_strtcpy_a_trunc(void **);
-static void test_strtcpy_a_ok(void **);
+static void test_strtcpy_a_trunc(MAYBE_UNUSED void ** _1);
+static void test_strtcpy_a_ok(MAYBE_UNUSED void ** _1);
 
 
 int
@@ -35,7 +35,7 @@ main(void)
 
 
 static void
-test_strtcpy_a_trunc(void **)
+test_strtcpy_a_trunc(MAYBE_UNUSED void ** _1)
 {
        char  buf[countof("foo")];
 
@@ -49,7 +49,7 @@ test_strtcpy_a_trunc(void **)
 
 
 static void
-test_strtcpy_a_ok(void **)
+test_strtcpy_a_ok(MAYBE_UNUSED void ** _1)
 {
        char  buf[countof("foo")];
 
index d1e6ebc34c94e51b58b2f665c4afd69cc1673582..f547ec193a16980dfb9998e7217c058f9f2eec2e 100644 (file)
 #include <cmocka.h>
 
 #include "typetraits.h"
+#include "attr.h"
 
-
-static void test_type_max(void **);
-static void test_type_min(void **);
+static void test_type_max(MAYBE_UNUSED void ** _1);
+static void test_type_min(MAYBE_UNUSED void ** _1);
 
 
 int
@@ -30,7 +30,7 @@ main(void)
 
 
 static void
-test_type_max(void **)
+test_type_max(MAYBE_UNUSED void ** _1)
 {
        assert_true(type_max(long) == LONG_MAX);
        assert_true(type_max(unsigned long) == ULONG_MAX);
@@ -43,7 +43,7 @@ test_type_max(void **)
 
 
 static void
-test_type_min(void **)
+test_type_min(MAYBE_UNUSED void ** _1)
 {
        assert_true(type_min(long) == LONG_MIN);
        assert_true(type_min(unsigned long) == 0);