Conversation
lib/loginprompt.c
Outdated
|
|
||
| static void | ||
| login_exit(int) | ||
| static void login_exit (MAYBE_UNUSED int sig) |
There was a problem hiding this comment.
If we really need to fix the regression, I'd like to not revert the commits. Instead, please call the parameters _ in a new commit. When there is more than one, please call them _, __, ___, etc.
There was a problem hiding this comment.
Got it. I'll squash these into one patch and use parameters like '_'.
There was a problem hiding this comment.
Sorry, after some thought, _ will collide with the _() function from GNU gettext. Also, __ is a reserved identifier.
So, we'll need _1, _2, ...
There was a problem hiding this comment.
@alejandro-colomar I just came back from a vacation. I will work on this ASAP. Thanks for your above _1 suggestion.
ea42e16 to
a2a0eff
Compare
|
@alejandro-colomar I've squashed the codes with extra fixes for the tests/unit directory. |
lib/copydir.c
Outdated
| format_attr(printf, 2, 3) | ||
| static void | ||
| error_acl(struct error_context *, const char *fmt, ...) | ||
| static void error_acl (MAYBE_UNUSED struct error_context *_1, const char *fmt, ...) |
There was a problem hiding this comment.
Please keep the return type in a separate line (and don't add white space).
tests/unit/test_logind.c
Outdated
| * TEST | ||
| **********************/ | ||
| static void test_active_sessions_count_return_ok(void **) | ||
| static void test_active_sessions_count_return_ok(MAYBE_UNUSED MAYBE_UNUSED void ** _1_1) |
There was a problem hiding this comment.
Why _1_1 instead of _1?
There was a problem hiding this comment.
Oh, and MAYBE_UNUSED is also dup'd. It seems some script went wrong. :)
There was a problem hiding this comment.
BTW, if you use a script, please document it in the commit message (script contents and/or shell session).
There was a problem hiding this comment.
I was manually changing things. Sorry for the typo. I think I was hitting Ctrl-y twice in emacs. I'll fix all the above issues and update this PR.
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: <shadow-maint#1530> Signed-off-by: Chen Qi <[email protected]>
a2a0eff to
2e22a45
Compare
|
@alejandro-colomar I've updated this PR to address the above concerns. The testing method is the same as above. |
| 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, ...) |
There was a problem hiding this comment.
Please don't introduce white space.
|
|
||
| static void | ||
| log_gpasswd_failure_system(void *) | ||
| log_gpasswd_failure_system (MAYBE_UNUSED void *_1) |
There was a problem hiding this comment.
Please don't introduce white space.
There was a problem hiding this comment.
Got it. I'll remove the whitespace and update this PR.
This PR fixes the error for gcc10:
error: parameter name omitted