Enable -Wmissing-format-attribute warning

Add a couple of missing ATTRIBUTE_FMT_PRINTF annotations

* tools/virsh.c, tests/testutils.c: Add printf format attribute
* m4/virt-compile-warnings.m4: Enable -Wmissing-format-attribute
This commit is contained in:
Daniel P. Berrange 2010-07-16 16:38:10 +01:00
parent 4825b521e2
commit 7d76d5d506
3 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,6 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
dontwarn="$dontwarn -Wpacked" dontwarn="$dontwarn -Wpacked"
dontwarn="$dontwarn -Wunused-macros" dontwarn="$dontwarn -Wunused-macros"
dontwarn="$dontwarn -Woverlength-strings" dontwarn="$dontwarn -Woverlength-strings"
dontwarn="$dontwarn -Wmissing-format-attribute"
dontwarn="$dontwarn -Wstack-protector" dontwarn="$dontwarn -Wstack-protector"
# Get all possible GCC warnings # Get all possible GCC warnings

View File

@ -67,7 +67,7 @@ virtTestCountAverage(double *items, int nitems)
return (double) (sum / nitems); return (double) (sum / nitems);
} }
ATTRIBUTE_FMT_PRINTF(3,4)
void virtTestResult(const char *name, int ret, const char *msg, ...) void virtTestResult(const char *name, int ret, const char *msg, ...)
{ {
va_list vargs; va_list vargs;

View File

@ -243,7 +243,8 @@ static int vshInit(vshControl *ctl);
static int vshDeinit(vshControl *ctl); static int vshDeinit(vshControl *ctl);
static void vshUsage(void); static void vshUsage(void);
static void vshOpenLogFile(vshControl *ctl); static void vshOpenLogFile(vshControl *ctl);
static void vshOutputLogFile(vshControl *ctl, int log_level, const char *format, va_list ap); static void vshOutputLogFile(vshControl *ctl, int log_level, const char *format, va_list ap)
ATTRIBUTE_FMT_PRINTF(3, 0);
static void vshCloseLogFile(vshControl *ctl); static void vshCloseLogFile(vshControl *ctl);
static int vshParseArgv(vshControl *ctl, int argc, char **argv); static int vshParseArgv(vshControl *ctl, int argc, char **argv);