From fdeeb6f8547617a0478ffe847b76c46fa45487d0 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Tue, 4 Sep 2012 20:29:08 +0200 Subject: Add compilation checks for printf-style format strings Append the format() __attribute__ to function prototypes which use a format string. This allows GCC to check for consistency between the format string and its arguments when these functions are called. Signed-off-by: Guillaume Nault --- accel-pppd/cli/cli.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'accel-pppd/cli') diff --git a/accel-pppd/cli/cli.h b/accel-pppd/cli/cli.h index 3e31c5d8..1fbb985e 100644 --- a/accel-pppd/cli/cli.h +++ b/accel-pppd/cli/cli.h @@ -42,7 +42,7 @@ void cli_register_regexp_cmd(struct cli_regexp_cmd_t *cmd); void cli_show_ses_register(const char *name, const char *desc, void (*print)(const struct ap_session *ses, char *buf)); int cli_send(void *client, const char *data); -int cli_sendv(void *client, const char *fmt, ...); +int cli_sendv(void *client, const char *fmt, ...) __attribute__((format(gnu_printf, 2, 3))); #endif -- cgit v1.2.3