diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-12-12 15:09:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-12-12 15:31:26 +0000 |
commit | 5925cd3e9c3cea926aee6c78aaa1f708665dfa8d (patch) | |
tree | 320055be10c839fb0f97910a5418803ce43377a8 /security | |
parent | c7823054d431d2e7a0ff064b8c40d51b97156220 (diff) | |
download | ports-5925cd3e9c3cea926aee6c78aaa1f708665dfa8d.tar.gz ports-5925cd3e9c3cea926aee6c78aaa1f708665dfa8d.zip |
security/cracklib: fix build with clang 15
During an exp-run for llvm 15 (see bug 265425), it turned out that
security/cracklib failed to build with clang 15:
rules.c:346:50: warning: too few arguments in call to 'Debug'
Debug(1, "MatchClass: unknown class %c\n", class);
~~~~~ ^
rules.c:346:45: error: incompatible integer to pointer conversion passing 'char' to parameter of type 'char *'; take the address with & [-Wint-conversion]
Debug(1, "MatchClass: unknown class %c\n", class);
^~~~~
&
This is because cracklib is very old K&R source, and the Debug()
function is not defined with varargs, but an arbitrary amount of char
pointer arguments.
Since the Debug() function does nothing anyway, define it as a varargs
macro instead. This also gets rid of most of the other compilation
warnings.
PR: 268334
Approved by: cy (maintainer)
MFH: 2022Q4
Diffstat (limited to 'security')
-rw-r--r-- | security/cracklib/files/patch-lib_rules.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/security/cracklib/files/patch-lib_rules.c b/security/cracklib/files/patch-lib_rules.c new file mode 100644 index 000000000000..db39252161ad --- /dev/null +++ b/security/cracklib/files/patch-lib_rules.c @@ -0,0 +1,11 @@ +--- lib/rules.c.orig 2019-02-14 01:54:41 UTC ++++ lib/rules.c +@@ -26,6 +26,8 @@ Debug(val, a, b, c, d, e, f, g) + { + fprintf(stderr, a, b, c, d, e, f, g); + } ++#elif 1 ++#define Debug(n, f, ...) do {} while (0) + #else + static void + Debug(val, a, b, c, d, e, f, g) |