aboutsummaryrefslogtreecommitdiffstats
path: root/utils.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-12 14:25:23 +0100
committerDavid Sterba <dsterba@suse.com>2016-01-12 15:02:55 +0100
commit407f928cd2ae67a93a7ed618a7776cdacc8f6834 (patch)
treedf1d2a1a501fb9d8f01dad0a956ed8d6a8a5eb47 /utils.h
parentf9ae9147562c6402c000b241af257a3170ec270a (diff)
downloadbtrfs-progs-407f928cd2ae67a93a7ed618a7776cdacc8f6834.tar.gz
btrfs-progs-407f928cd2ae67a93a7ed618a7776cdacc8f6834.tar.xz
btrfs-progs-407f928cd2ae67a93a7ed618a7776cdacc8f6834.zip
btrfs-progs: add function attributes for the printf-like
Reported by gcc -Wsuggest-attribute=format . Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils.h b/utils.h
index 493c2e4..e522a8c 100644
--- a/utils.h
+++ b/utils.h
@@ -276,6 +276,7 @@ const char *get_argv0_buf(void);
unsigned int get_unit_mode_from_arg(int *argc, char *argv[], int df_mode);
int string_is_numerical(const char *str);
+__attribute__ ((format (printf, 1, 2)))
static inline void warning(const char *fmt, ...)
{
va_list args;
@@ -287,6 +288,7 @@ static inline void warning(const char *fmt, ...)
fputc('\n', stderr);
}
+__attribute__ ((format (printf, 1, 2)))
static inline void error(const char *fmt, ...)
{
va_list args;
@@ -298,6 +300,7 @@ static inline void error(const char *fmt, ...)
fputc('\n', stderr);
}
+__attribute__ ((format (printf, 2, 3)))
static inline int warning_on(int condition, const char *fmt, ...)
{
va_list args;
@@ -314,6 +317,7 @@ static inline int warning_on(int condition, const char *fmt, ...)
return 1;
}
+__attribute__ ((format (printf, 2, 3)))
static inline int error_on(int condition, const char *fmt, ...)
{
va_list args;