diff mbox series

[6/9] btrfs-progs: Fix Wsuggest-attribute=format warning

Message ID 20181116075426.4142-7-wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: Make W=1 clean (no "again") | expand

Commit Message

Qu Wenruo Nov. 16, 2018, 7:54 a.m. UTC
Add __attribute__ ((format (printf, 4, 0))) to fix the vprintf calling
function.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 string-table.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Nikolay Borisov Nov. 16, 2018, 8:06 a.m. UTC | #1
On 16.11.18 г. 9:54 ч., Qu Wenruo wrote:
> Add __attribute__ ((format (printf, 4, 0))) to fix the vprintf calling
> function.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  string-table.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/string-table.c b/string-table.c
> index 95833768960d..455285702d51 100644
> --- a/string-table.c
> +++ b/string-table.c
> @@ -48,6 +48,7 @@ struct string_table *table_create(int columns, int rows)
>   * '>' the text is right aligned. If fmt is equal to '=' the text will
>   * be replaced by a '=====' dimensioned on the basis of the column width
>   */
> +__attribute__ ((format (printf, 4, 0)))
>  char *table_vprintf(struct string_table *tab, int column, int row,
>  			  const char *fmt, va_list ap)
>  {
>
diff mbox series

Patch

diff --git a/string-table.c b/string-table.c
index 95833768960d..455285702d51 100644
--- a/string-table.c
+++ b/string-table.c
@@ -48,6 +48,7 @@  struct string_table *table_create(int columns, int rows)
  * '>' the text is right aligned. If fmt is equal to '=' the text will
  * be replaced by a '=====' dimensioned on the basis of the column width
  */
+__attribute__ ((format (printf, 4, 0)))
 char *table_vprintf(struct string_table *tab, int column, int row,
 			  const char *fmt, va_list ap)
 {