From e28459d8836810a1ea057ff2d47f223fb4f110e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 22 Dec 2016 16:36:06 +0100 Subject: Apply format string attribute to printf style functions Not strictly C99 conform, but widely supported and easy enough to NOP for compilers which do not support it. Besides it was already used to mark certain functions as noreturn. --- vis.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vis.h') diff --git a/vis.h b/vis.h index ce6e42b..3b9ede7 100644 --- a/vis.h +++ b/vis.h @@ -122,7 +122,7 @@ int vis_window_height_get(const Win*); void vis_prompt_show(Vis*, const char *title); /* display a one line message to the user, will be hidden upon keypress */ -void vis_info_show(Vis*, const char *msg, ...); +void vis_info_show(Vis*, const char *msg, ...) __attribute__((format(printf, 2, 3))); void vis_info_hide(Vis*); /* display an arbitrary long message in a special window/file */ @@ -150,7 +150,7 @@ int vis_run(Vis*, int argc, char *argv[]); /* terminate editing session, given status will be the return value of vis_run */ void vis_exit(Vis*, int status); /* emergency exit, print given message, perform minimal ui cleanup and exit process */ -void vis_die(Vis*, const char *msg, ...) __attribute__((noreturn)); +void vis_die(Vis*, const char *msg, ...) __attribute__((noreturn,format(printf, 2, 3))); enum VisMode { VIS_MODE_NORMAL, -- cgit v1.2.3