From e4d2bfdd73648f4b2bce123b6425d3e63bb99f33 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Thu, 25 Apr 2013 21:31:05 -0400 Subject: Add printf attributes in exported headers gcc (and other compilers) sometimes generate spurious warnings, and thus users of public headers must be able to disable warnings. Printf format attributes can be disabled by setting #define _sd_printf_attr_ before including the header file. Also, add similar logic for sentinel attribute: #define _sd_sentinel_attr_ before including the header file disables the attribute. --- src/udev/udev.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/udev/udev.h') diff --git a/src/udev/udev.h b/src/udev/udev.h index 906dfbaa0b..caec5f0a5d 100644 --- a/src/udev/udev.h +++ b/src/udev/udev.h @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -#ifndef _UDEV_H_ -#define _UDEV_H_ +#pragma once #include #include #include +#include "macro.h" #include "libudev.h" #include "libudev-private.h" #include "util.h" @@ -195,7 +195,7 @@ int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *modalias, bool /* udev logging */ void udev_main_log(struct udev *udev, int priority, const char *file, int line, const char *fn, - const char *format, va_list args); + const char *format, va_list args) _printf_attr_(6, 0); /* udevadm commands */ struct udevadm_cmd { @@ -212,4 +212,3 @@ extern const struct udevadm_cmd udevadm_monitor; extern const struct udevadm_cmd udevadm_hwdb; extern const struct udevadm_cmd udevadm_test; extern const struct udevadm_cmd udevadm_test_builtin; -#endif -- cgit v1.2.3-54-g00ecf