Alan Jenkins | 29 Sep 18:49

Debug build fails

udevadm-info.c: In function ‘print_all_attributes’:
udevadm-info.c:65: error: ‘udev’ undeclared (first use in this function)
udevadm-info.c:65: error: (Each undeclared identifier is reported only once
udevadm-info.c:65: error: for each function it appears in.)
udevadm-info.c:72: error: ‘info’ undeclared (first use in this function)

The dbg() macro sucks.  The disabled version should be an inline
function, so it catches these errors on normal builds. 

Obviously the callers need to be fixed before this can be applied.

------------>

Allow compiler to check dbg() arguments on non-debug builds

Signed-off-by: Alan Jenkins <alan-jenkins <at> tuffmail.co.uk>

diff --git a/udev/lib/libudev-private.h b/udev/lib/libudev-private.h
index 162b33a..8f84715 100644
--- a/udev/lib/libudev-private.h
+++ b/udev/lib/libudev-private.h
@@ -23,12 +23,17 @@
 #include <syslog.h>
 #include "libudev.h"

+static inline void __attribute__ ((format(printf, 2, 3)))
+log_null(struct udev *udev, const char *format, ...)
+{
+}
+
(Continue reading)

Kay Sievers | 29 Sep 19:02
Gravatar

Re: Debug build fails

On Mon, 2008-09-29 at 17:50 +0100, Alan Jenkins wrote:
> udevadm-info.c: In function ‘print_all_attributes’:
> udevadm-info.c:65: error: ‘udev’ undeclared (first use in this function)
> udevadm-info.c:65: error: (Each undeclared identifier is reported only once
> udevadm-info.c:65: error: for each function it appears in.)
> udevadm-info.c:72: error: ‘info’ undeclared (first use in this function)
> 
> 
> The dbg() macro sucks.  The disabled version should be an inline
> function, so it catches these errors on normal builds. 

Sounds good.

> Obviously the callers need to be fixed before this can be applied.

Done.

> Allow compiler to check dbg() arguments on non-debug builds

Applied.

Thanks,
Kay

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)


Gmane