configure: add '-Wundef' to warning flags
[lttng-tools.git] / src / bin / lttng-sessiond / modprobe.cpp
index 7e27a02eb4aba019f7108d1a8a7c0250785e4932..9f6c4a9c3edabb8e64b39de0c8087d54bee0d669 100644 (file)
@@ -242,13 +242,14 @@ static struct kern_modules_param *probes;
 static int nr_probes;
 static int probes_capacity;
 
-#if HAVE_KMOD
+#ifdef HAVE_KMOD
 #include <libkmod.h>
 
 /**
  * @brief Logging function for libkmod integration.
  */
-static void log_kmod(void *data, int priority, const char *file, int line,
+static ATTR_FORMAT_PRINTF(6, 0)
+void log_kmod(void *data, int priority, const char *file, int line,
                const char *fn, const char *format, va_list args)
 {
        char *str;
@@ -281,7 +282,15 @@ static int setup_kmod_ctx(struct kmod_ctx **ctx)
                goto error;
        }
 
+       /*
+        * Parameter 2 of kmod_set_log_fn generates a
+        * -Wsuggest-attribute=formatkmod_set_log_fn warning that we can't fix,
+        * ignore it.
+        */
+       DIAGNOSTIC_PUSH
+       DIAGNOSTIC_IGNORE_SUGGEST_ATTRIBUTE_FORMAT
        kmod_set_log_fn(*ctx, log_kmod, NULL);
+       DIAGNOSTIC_POP
        ret = kmod_load_resources(*ctx);
        if (ret < 0) {
                ERR("Failed to load kmod library resources");
This page took 0.024205 seconds and 4 git commands to generate.