[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <hm3lxgfzjhxigj5no5csubdo6kolvdjwyhpveirbzptcdbmcag@tqunw2rllae4>
Date: Tue, 1 Jul 2025 21:27:24 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH] lib/vsprintf: include stdarg.h from sprintf.h to provide
va_list
Declarations in sprintf.h use va_list so it needs to include stdarg.h,
otherwise we may be getting warnings like this:
./include/linux/sprintf.h:11:54: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
11 | __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
| ^
| int
Fixes: 39ced19b9e60 ("lib/vsprintf: split out sprintf() and friends")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
---
Can I take it through my tree if acked?
include/linux/sprintf.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/sprintf.h b/include/linux/sprintf.h
index 51cab2def9ec..9ec0033f4106 100644
--- a/include/linux/sprintf.h
+++ b/include/linux/sprintf.h
@@ -3,6 +3,7 @@
#define _LINUX_KERNEL_SPRINTF_H_
#include <linux/compiler_attributes.h>
+#include <linux/stdarg.h>
#include <linux/types.h>
int num_to_str(char *buf, int size, unsigned long long num, unsigned int width);
--
2.50.0.727.gbf7dc18ff4-goog
--
Dmitry
Powered by blists - more mailing lists