Commit b1e2b33c authored by Cristian Rodríguez's avatar Cristian Rodríguez Committed by Zbigniew Jędrzejewski-Szmek

Add some extra __attribute__ ((format)) s

parent 750ef272
......@@ -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);
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......@@ -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,
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment