summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-10-16 03:17:09 +0200
committerAnthony G. Basile <blueness@gentoo.org>2014-01-09 14:58:12 -0500
commitbae7baca80ea532372c7924fe5734808282c5b2e (patch)
tree5862965d7cd6684173f7e3068d110d6b2f3eed36 /src/libudev
parentbc681b6fb2639772af71acc9fc4614a1b5932a7e (diff)
macro: clean up usage of gcc attributes
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-private.h6
-rw-r--r--src/libudev/log.h4
-rw-r--r--src/libudev/macro.h2
-rw-r--r--src/libudev/strxcpyx.h8
4 files changed, 11 insertions, 9 deletions
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h
index 54c51acc23..18bc853a5a 100644
--- a/src/libudev/libudev-private.h
+++ b/src/libudev/libudev-private.h
@@ -48,8 +48,7 @@
/* libudev.c */
void udev_log(struct udev *udev,
int priority, const char *file, int line, const char *fn,
- const char *format, ...)
- __attribute__((format(printf, 6, 7)));
+ const char *format, ...) _printf_(6, 7);
int udev_get_rules_path(struct udev *udev, char **path[], usec_t *ts_usec[]);
struct udev_list_entry *udev_add_property(struct udev *udev, const char *key, const char *value);
struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev);
@@ -175,5 +174,6 @@ int util_delete_path(struct udev *udev, const char *path);
uid_t util_lookup_user(struct udev *udev, const char *user);
gid_t util_lookup_group(struct udev *udev, const char *group);
int util_resolve_subsys_kernel(struct udev *udev, const char *string, char *result, size_t maxsize, int read_value);
-ssize_t print_kmsg(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
+ssize_t print_kmsg(const char *fmt, ...) _printf_(1, 2);
+
#endif
diff --git a/src/libudev/log.h b/src/libudev/log.h
index 2ecba45abb..23ada2255c 100644
--- a/src/libudev/log.h
+++ b/src/libudev/log.h
@@ -58,7 +58,7 @@ int log_meta(
const char*file,
int line,
const char *func,
- const char *format, ...) _printf_attr_(5,6);
+ const char *format, ...) _printf_(5,6);
int log_metav(
int level,
@@ -66,7 +66,7 @@ int log_metav(
int line,
const char *func,
const char *format,
- va_list ap) _printf_attr_(5,0);
+ va_list ap) _printf_(5,0);
int log_oom_internal(
const char *file,
diff --git a/src/libudev/macro.h b/src/libudev/macro.h
index d24c779e7c..dddc040cec 100644
--- a/src/libudev/macro.h
+++ b/src/libudev/macro.h
@@ -27,7 +27,7 @@
#include <sys/uio.h>
#include <inttypes.h>
-#define _printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
+#define _printf_(a,b) __attribute__ ((format (printf, a, b)))
#define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__)))
#define _sentinel_ __attribute__ ((sentinel))
#define _noreturn_ __attribute__((noreturn))
diff --git a/src/libudev/strxcpyx.h b/src/libudev/strxcpyx.h
index 962c389e93..e3450311df 100644
--- a/src/libudev/strxcpyx.h
+++ b/src/libudev/strxcpyx.h
@@ -24,8 +24,10 @@
#include <stdarg.h>
#include <stdbool.h>
+#include "macro.h"
+
size_t strpcpy(char **dest, size_t size, const char *src);
-size_t strpcpyf(char **dest, size_t size, const char *src, ...) __attribute__((format(printf, 3, 4)));
-size_t strpcpyl(char **dest, size_t size, const char *src, ...) __attribute__((sentinel));
+size_t strpcpyf(char **dest, size_t size, const char *src, ...) _printf_(3, 4);
+size_t strpcpyl(char **dest, size_t size, const char *src, ...) _sentinel_;
size_t strscpy(char *dest, size_t size, const char *src);
-size_t strscpyl(char *dest, size_t size, const char *src, ...) __attribute__((sentinel));
+size_t strscpyl(char *dest, size_t size, const char *src, ...) _sentinel_;