All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/vsprintf: include stdarg.h from sprintf.h to provide va_list
@ 2025-07-02  4:27 Dmitry Torokhov
  2025-07-02  8:07 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2025-07-02  4:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andy Shevchenko

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@gmail.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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lib/vsprintf: include stdarg.h from sprintf.h to provide va_list
  2025-07-02  4:27 [PATCH] lib/vsprintf: include stdarg.h from sprintf.h to provide va_list Dmitry Torokhov
@ 2025-07-02  8:07 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2025-07-02  8:07 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-kernel

On Tue, Jul 01, 2025 at 09:27:24PM -0700, Dmitry Torokhov wrote:
> 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

Ah, thanks for a good catch!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-02  8:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02  4:27 [PATCH] lib/vsprintf: include stdarg.h from sprintf.h to provide va_list Dmitry Torokhov
2025-07-02  8:07 ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.