diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-06-08 11:43:55 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-06-08 15:49:40 +0200 |
commit | c55139bfaabd3e5112486716f262936e85a2fb18 (patch) | |
tree | 93c4960915b8bdf198d6d462740560c862684c39 | |
parent | 8436ab7ff084ed650132fbb0a72a85a0c0c54f7c (diff) | |
download | libpam-freerdp2-c55139bfaabd3e5112486716f262936e85a2fb18.tar.gz libpam-freerdp2-c55139bfaabd3e5112486716f262936e85a2fb18.tar.bz2 libpam-freerdp2-c55139bfaabd3e5112486716f262936e85a2fb18.zip |
tests/mock_*.c: Mark unused function arguments as such.
This resolves:
mock_pam.c: In function 'fake_conv':
mock_pam.c:22:20: error: unused parameter 'num_msg' [-Werror=unused-parameter]
22 | int fake_conv (int num_msg, const struct pam_message **msg,
| ~~~~^~~~~~~
mock_pam.c:23:39: error: unused parameter 'appdata_ptr' [-Werror=unused-parameter]
23 | struct pam_response **resp, void *appdata_ptr)
| ~~~~~~^~~~~~~~~~~
mock_pam.c: In function 'fake_conv_empty_password':
mock_pam.c:51:35: error: unused parameter 'num_msg' [-Werror=unused-parameter]
51 | int fake_conv_empty_password (int num_msg, const struct pam_message **msg,
| ~~~~^~~~~~~
mock_pam.c:52:39: error: unused parameter 'appdata_ptr' [-Werror=unused-parameter]
52 | struct pam_response **resp, void *appdata_ptr)
| ~~~~~~^~~~~~~~~~~
cc1: all warnings being treated as errors
-rw-r--r-- | tests/mock_guest.c | 23 | ||||
-rw-r--r-- | tests/mock_pam.c | 12 |
2 files changed, 22 insertions, 13 deletions
diff --git a/tests/mock_guest.c b/tests/mock_guest.c index 7673995..218f30e 100644 --- a/tests/mock_guest.c +++ b/tests/mock_guest.c @@ -22,39 +22,44 @@ static struct passwd guest = { "guest", "/tmp", "/bin/true" }; struct passwd * -getpwnam (const char *username) +getpwnam (const char __attribute__((unused)) *username) { return &guest; } int -setgroups(size_t size, const gid_t *list) +setgroups(size_t __attribute__((unused)) size, + const gid_t __attribute__((unused)) *list) { errno = EPERM; return -1; } int -setgid(gid_t gid) +setgid(gid_t __attribute__((unused)) gid) { return 0; } int -setuid(uid_t uid) +setuid(uid_t __attribute__((unused)) uid) { return 0; } int -setegid(gid_t gid) +setegid(gid_t __attribute__((unused)) gid) { return 0; } int -seteuid(uid_t uid) +seteuid(uid_t __attribute__((unused)) uid) { return 0; } -int chmod(const char *path, mode_t mode) +int chmod(const char __attribute__((unused)) *path, + mode_t __attribute__((unused)) mode) { return 0; } -int chown(const char *path, uid_t owner, gid_t group) +int chown(const char __attribute__((unused)) *path, + uid_t __attribute__((unused)) owner, + gid_t __attribute__((unused)) group) { return 0; } -int execvp(const char *file, char *const argv[]) +int execvp(const char __attribute__((unused)) *file, + char __attribute__((unused)) *const argv[]) { return 0; } diff --git a/tests/mock_pam.c b/tests/mock_pam.c index ce57973..e1b7324 100644 --- a/tests/mock_pam.c +++ b/tests/mock_pam.c @@ -19,8 +19,10 @@ struct pam_handle { /* note: the other fields have been omitted */ }; -int fake_conv (int num_msg, const struct pam_message **msg, - struct pam_response **resp, void *appdata_ptr) +int fake_conv (int __attribute__((unused)) num_msg, + const struct pam_message **msg, + struct pam_response **resp, + void __attribute__((unused)) *appdata_ptr) { struct pam_response *response = NULL; response = malloc (sizeof (struct pam_response)); @@ -48,8 +50,10 @@ int fake_conv (int num_msg, const struct pam_message **msg, return PAM_SUCCESS; } -int fake_conv_empty_password (int num_msg, const struct pam_message **msg, - struct pam_response **resp, void *appdata_ptr) +int fake_conv_empty_password (int __attribute__((unused)) num_msg, + const struct pam_message **msg, + struct pam_response **resp, + void __attribute__((unused)) *appdata_ptr) { struct pam_response *response = NULL; response = malloc (sizeof (struct pam_response)); |