diff options
author | Cristian Rodríguez <crrodriguez@opensuse.org> | 2013-04-02 04:02:58 -0300 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-25 21:50:48 -0400 |
commit | b1e2b33c5258f1cefcee55116ac5d049478c804d (patch) | |
tree | dc3e50cb79c51c85b2a16b825c89cc7bafeecbc7 | |
parent | 750ef27274cdc274f8c6b9245d6ba0179c68fa50 (diff) |
Add some extra __attribute__ ((format)) s
-rw-r--r-- | src/core/manager.h | 2 | ||||
-rw-r--r-- | src/core/unit.c | 3 | ||||
-rw-r--r-- | src/core/unit.h | 2 | ||||
-rw-r--r-- | src/journal/journald-server.h | 2 | ||||
-rw-r--r-- | src/journal/microhttpd-util.h | 4 | ||||
-rw-r--r-- | src/shared/log.h | 6 | ||||
-rw-r--r-- | src/shared/util.h | 4 |
7 files changed, 14 insertions, 9 deletions
diff --git a/src/core/manager.h b/src/core/manager.h index a0be2927f7..b9bd2099f8 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -301,6 +301,6 @@ void manager_undo_generators(Manager *m); void manager_recheck_journal(Manager *m); void manager_set_show_status(Manager *m, bool b); -void manager_status_printf(Manager *m, bool ephemeral, const char *status, const char *format, ...); +void manager_status_printf(Manager *m, bool ephemeral, const char *status, const char *format, ...) _printf_attr_(4,5); void watch_init(Watch *w); diff --git a/src/core/unit.c b/src/core/unit.c index b4a4f8cd2e..7029b6443e 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -2576,9 +2576,12 @@ int unit_coldplug(Unit *u) { return 0; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" void unit_status_printf(Unit *u, const char *status, const char *unit_status_msg_format) { manager_status_printf(u->manager, false, status, unit_status_msg_format, unit_description(u)); } +#pragma GCC diagnostic pop bool unit_need_daemon_reload(Unit *u) { _cleanup_strv_free_ char **t = NULL; diff --git a/src/core/unit.h b/src/core/unit.h index a086538c61..0f121e244e 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -528,7 +528,7 @@ int unit_add_node_link(Unit *u, const char *what, bool wants); int unit_coldplug(Unit *u); -void unit_status_printf(Unit *u, const char *status, const char *unit_status_msg_format); +void unit_status_printf(Unit *u, const char *status, const char *unit_status_msg_format) _printf_attr_(3, 0); bool unit_need_daemon_reload(Unit *u); diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h index fb4e8e4c3d..86f7145292 100644 --- a/src/journal/journald-server.h +++ b/src/journal/journald-server.h @@ -130,7 +130,7 @@ typedef struct Server { #define N_IOVEC_UDEV_FIELDS 32 void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, unsigned m, struct ucred *ucred, struct timeval *tv, const char *label, size_t label_len, const char *unit_id, int priority); -void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...); +void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...) _printf_attr_(3,4); /* gperf lookup function */ const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length); diff --git a/src/journal/microhttpd-util.h b/src/journal/microhttpd-util.h index d4fefa72d3..20ad76990c 100644 --- a/src/journal/microhttpd-util.h +++ b/src/journal/microhttpd-util.h @@ -23,4 +23,6 @@ #include <stdarg.h> -void microhttpd_logger(void *arg, const char *fmt, va_list ap); +#include "macro.h" + +void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_attr_(2, 0); diff --git a/src/shared/log.h b/src/shared/log.h index 9aafcb4100..5fc89880ad 100644 --- a/src/shared/log.h +++ b/src/shared/log.h @@ -83,7 +83,7 @@ int log_metav( int line, const char *func, const char *format, - va_list ap); + va_list ap) _printf_attr_(5,0); int log_meta_object( int level, @@ -102,14 +102,14 @@ int log_metav_object( const char *object_name, const char *object, const char *format, - va_list ap); + va_list ap) _printf_attr_(7,0); int log_struct_internal( int level, const char *file, int line, const char *func, - const char *format, ...) _sentinel_; + const char *format, ...) _printf_attr_(5,0) _sentinel_; int log_oom_internal( const char *file, diff --git a/src/shared/util.h b/src/shared/util.h index 69b717ed93..68e87da7cd 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -361,8 +361,8 @@ int pipe_eof(int fd); cpu_set_t* cpu_set_malloc(unsigned *ncpus); -int status_vprintf(const char *status, bool ellipse, bool ephemeral, const char *format, va_list ap); -int status_printf(const char *status, bool ellipse, bool ephemeral, const char *format, ...); +int status_vprintf(const char *status, bool ellipse, bool ephemeral, const char *format, va_list ap) _printf_attr_(4,0); +int status_printf(const char *status, bool ellipse, bool ephemeral, const char *format, ...) _printf_attr_(4,5); int status_welcome(void); int fd_columns(int fd); |