diff mbox series

[4/4] test-rtnl: fix -std=c23 build failure

Message ID 20241117001814.2149181-4-slyich@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/4] settings: fix -std=c23 build failure | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success

Commit Message

Sergei Trofimovich Nov. 17, 2024, 12:18 a.m. UTC
gcc-15 switched to -std=c23 by default:

    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

As a result `ell` fails the build as:

    unit/test-rtnl.c: In function 'test_run':
    unit/test-rtnl.c:501:24: error:
      passing argument 1 of 'l_idle_oneshot' from incompatible pointer type [-Wincompatible-pointer-types]
      501 |         l_idle_oneshot(test_next, NULL, NULL);
          |                        ^~~~~~~~~
          |                        |
          |                        void (*)(void)
---
 unit/test-rtnl.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/unit/test-rtnl.c b/unit/test-rtnl.c
index 59d8492..6fbac9e 100644
--- a/unit/test-rtnl.c
+++ b/unit/test-rtnl.c
@@ -358,6 +358,12 @@  static void test_next()
 	test->start(rtnl, test->data);
 }
 
+static void test_next_cb(void * unused)
+{
+	(void)unused;
+	test_next();
+}
+
 #define test_assert(cond)	\
 	do {	\
 		if (!(cond)) {	\
@@ -498,7 +504,7 @@  static void test_run(void)
 {
 	success = false;
 
-	l_idle_oneshot(test_next, NULL, NULL);
+	l_idle_oneshot(test_next_cb, NULL, NULL);
 	l_main_run_with_signal(signal_handler, NULL);
 }