mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-06 21:01:43 +00:00
btrfs-progs: add function attributes for the printf-like
Reported by gcc -Wsuggest-attribute=format . Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f9ae914756
commit
407f928cd2
@ -69,6 +69,7 @@ char *table_vprintf(struct string_table *tab, int column, int row,
|
||||
* This function is like a printf, but store the results in a cell of
|
||||
* the table.
|
||||
*/
|
||||
__attribute__ ((format (printf, 4, 5)))
|
||||
char *table_printf(struct string_table *tab, int column, int row,
|
||||
char *fmt, ...)
|
||||
{
|
||||
|
4
utils.h
4
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;
|
||||
|
Loading…
Reference in New Issue
Block a user