From c3a934d277c3a8ef528152b10e658a8f22b4df49 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 6 Nov 2016 15:08:17 +1030 Subject: [PATCH] container_of: Make example compile cleanly with -Wunused Make register_timer "use" my_timer_callback and its own args. Signed-off-by: Rusty Russell --- ccan/container_of/_info | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ccan/container_of/_info b/ccan/container_of/_info index d50094bc..b1160522 100644 --- a/ccan/container_of/_info +++ b/ccan/container_of/_info @@ -26,17 +26,19 @@ * struct timer timer; * }; * - * static void register_timer(struct timer *timer) - * { - * //... - * } - * * static void my_timer_callback(struct timer *timer) * { * struct info *info = container_of(timer, struct info, timer); * printf("my_stuff is %u\n", info->my_stuff); * } * + * static void register_timer(struct timer *timer) + * { + * (void)timer; + * (void)my_timer_callback; + * //... + * } + * * int main(void) * { * struct info info = { .my_stuff = 1 }; -- 2.39.2