diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-25 21:31:05 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-06-03 09:05:34 -0400 |
commit | 49799c750d18beab7a8af26071893780252118b3 (patch) | |
tree | 031cd7c958ae2dae14f1d6fae26a72d498a6fbec /src/udev/udev.h | |
parent | 7772dedbcf3bc6e5085f9351f44fe63f729109d0 (diff) |
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.
Diffstat (limited to 'src/udev/udev.h')
-rw-r--r-- | src/udev/udev.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/udev/udev.h b/src/udev/udev.h index be79d945fb..8e1726c543 100644 --- a/src/udev/udev.h +++ b/src/udev/udev.h @@ -16,13 +16,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _UDEV_H_ -#define _UDEV_H_ +#pragma once #include <sys/types.h> #include <sys/param.h> #include <signal.h> +#include "macro.h" #include "libudev.h" #include "libudev-private.h" #include "util.h" @@ -191,7 +191,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 { @@ -208,4 +208,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 |