From: Karel Zak Date: Wed, 29 Sep 2010 09:19:18 +0000 (+0200) Subject: libmount: use attribute __format__ for debug routines X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ccfc837ee1e7c8fc48626433fd2fcc8adc872b2;p=util-linux libmount: use attribute __format__ for debug routines Signed-off-by: Karel Zak --- diff --git a/shlibs/mount/src/mountP.h b/shlibs/mount/src/mountP.h index 9e8aa9da..289249e5 100644 --- a/shlibs/mount/src/mountP.h +++ b/shlibs/mount/src/mountP.h @@ -59,7 +59,8 @@ extern int libmount_debug_mask; -static inline void mnt_debug(const char *mesg, ...) +static inline void __attribute__ ((__format__ (__printf__, 1, 2))) +mnt_debug(const char *mesg, ...) { va_list ap; va_start(ap, mesg); @@ -68,7 +69,8 @@ static inline void mnt_debug(const char *mesg, ...) fputc('\n', stderr); } -static inline void mnt_debug_h(void *handler, const char *mesg, ...) +static inline void __attribute__ ((__format__ (__printf__, 2, 3))) +mnt_debug_h(void *handler, const char *mesg, ...) { va_list ap; diff --git a/shlibs/mount/src/optstr.c b/shlibs/mount/src/optstr.c index 507a7b53..626711c4 100644 --- a/shlibs/mount/src/optstr.c +++ b/shlibs/mount/src/optstr.c @@ -258,7 +258,8 @@ int mnt_optstr_prepend_option(char **optstr, const char *name, const char *value free(*optstr); *optstr = tmp; - DBG(OPTIONS, mnt_debug("failed to prepend '%s[=%s]' to '%s'", name, value, optstr)); + DBG(OPTIONS, mnt_debug("failed to prepend '%s[=%s]' to '%s'", + name, value, *optstr)); return rc; } diff --git a/shlibs/mount/src/tab.c b/shlibs/mount/src/tab.c index 39f7814e..b30bc00d 100644 --- a/shlibs/mount/src/tab.c +++ b/shlibs/mount/src/tab.c @@ -214,7 +214,7 @@ int mnt_tab_get_root_fs(mnt_tab *tb, mnt_fs **root) if (!tb || !root) return -EINVAL; - DBG(TAB, mnt_debug_h(tb, "lookup root fs", tb)); + DBG(TAB, mnt_debug_h(tb, "lookup root fs")); mnt_reset_iter(&itr, MNT_ITER_FORWARD); while(mnt_tab_next_fs(tb, &itr, &fs) == 0) { @@ -358,7 +358,7 @@ int mnt_tab_find_next_fs(mnt_tab *tb, mnt_iter *itr, if (!tb || !itr || !fs || !match_func) return -EINVAL; - DBG(TAB, mnt_debug_h(tb, "lookup next fs", tb)); + DBG(TAB, mnt_debug_h(tb, "lookup next fs")); if (!itr->head) MNT_ITER_INIT(itr, &tb->ents); diff --git a/shlibs/mount/src/tab_parse.c b/shlibs/mount/src/tab_parse.c index 18f66505..062b9040 100644 --- a/shlibs/mount/src/tab_parse.c +++ b/shlibs/mount/src/tab_parse.c @@ -399,7 +399,7 @@ static int mnt_tab_parse_next(mnt_tab *tb, FILE *f, mnt_fs *fs, */ return 0; err: - DBG(TAB, mnt_debug_h(tb, "%s:%d: parse error", tb, filename, *nlines)); + DBG(TAB, mnt_debug_h(tb, "%s:%d: parse error", filename, *nlines)); rc = 1; /* recoverable error */