diff options
-rw-r--r-- | src/libudev/libudev-private.h | 6 | ||||
-rw-r--r-- | src/libudev/log.h | 4 | ||||
-rw-r--r-- | src/libudev/macro.h | 2 | ||||
-rw-r--r-- | src/libudev/strxcpyx.h | 8 | ||||
-rw-r--r-- | src/udev/udev.h | 2 |
5 files changed, 12 insertions, 10 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_; diff --git a/src/udev/udev.h b/src/udev/udev.h index badbeb229f..f2145d7a5b 100644 --- a/src/udev/udev.h +++ b/src/udev/udev.h @@ -198,7 +198,7 @@ int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *prefix, const /* 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) _printf_attr_(6, 0); + const char *format, va_list args) _printf_(6, 0); /* udevadm commands */ struct udevadm_cmd { |