From 3fa2830829de2e3aa4bb916f164ae2fd75542ef3 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 10 Feb 2013 16:47:39 +1000 Subject: Add format attributes to all required functions Fixes all clang warnings with -Wformat-literal. Also, fix genuine formating issue discovered once adding these attributes and add a cast to prevent a gcc warning. Signed-off-by: Allan McRae --- src/pacman/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pacman/util.h') diff --git a/src/pacman/util.h b/src/pacman/util.h index c38291a9..2d1e6989 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -72,11 +72,11 @@ void print_packages(const alpm_list_t *packages); void select_display(const alpm_list_t *pkglist); int select_question(int count); int multiselect_question(char *array, int count); -int yesno(char *fmt, ...); -int noyes(char *fmt, ...); +int yesno(char *fmt, ...) __attribute__((format(printf, 1, 2))); +int noyes(char *fmt, ...) __attribute__((format(printf, 1, 2))); int pm_printf(alpm_loglevel_t level, const char *format, ...) __attribute__((format(printf,2,3))); -int pm_asprintf(char **string, const char *format, ...); +int pm_asprintf(char **string, const char *format, ...) __attribute__((format(printf,2,3))); int pm_vfprintf(FILE *stream, alpm_loglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0))); int pm_vasprintf(char **string, alpm_loglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0))); -- cgit v1.2.3-24-g4f1b