1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

Add some extra __attribute__ ((format)) s

This commit is contained in:
Cristian Rodríguez 2013-04-02 04:02:58 -03:00 committed by Zbigniew Jędrzejewski-Szmek
parent 750ef27274
commit b1e2b33c52
7 changed files with 14 additions and 9 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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,

View 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);