* unit-tests/test-dl.c (test_fn_check): Avoid strict aliasing
violation.
---
unit-tests/test-dl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unit-tests/test-dl.c b/unit-tests/test-dl.c
index d996bba5..51e73239 100644
--- a/unit-tests/test-dl.c
+++ b/unit-tests/test-dl.c
@@ -183,7 +183,7 @@ static void test_fn_check(void *fn, const char *expected)
{
char buf[16];
test_fn fn_p;
- *((void **) &fn_p) = fn;
+ fn_p = (test_fn)fn;
(*fn_p)(buf, sizeof(buf));
if (strncmp(buf, expected, 15) != 0)
abortmsg("Test function returned %s, expected %s", buf,
expected);
--
2.26.0
--
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."