* [PATCH] Enable gcc warnings for vsprintf/vsnprintf with "format" attribute
@ 2005-03-13 14:06 Marcelo Tosatti
0 siblings, 0 replies; only message in thread
From: Marcelo Tosatti @ 2005-03-13 14:06 UTC (permalink / raw)
To: torvalds, linux-kernel; +Cc: akpm
Applied to v2.4 - v2.6 wants the same change.
Against v2.6-BK.
From: Solar Designer <solar@openwall.com>
Enables gcc warnings for the case when arguments to vsprintf/vsnprintf
function don't match the format string. This helps catch programming
errors.
--- a/include/linux/kernel.h.orig 2005-03-13 14:42:52.069920616 -0300
+++ b/include/linux/kernel.h 2005-03-13 14:45:15.192162728 -0300
@@ -91,10 +91,12 @@
extern long long simple_strtoll(const char *,char **,unsigned int);
extern int sprintf(char * buf, const char * fmt, ...)
__attribute__ ((format (printf, 2, 3)));
-extern int vsprintf(char *buf, const char *, va_list);
+extern int vsprintf(char *buf, const char *, va_list)
+ __attribute__ ((format (printf, 2, 0)));
extern int snprintf(char * buf, size_t size, const char * fmt, ...)
__attribute__ ((format (printf, 3, 4)));
-extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
+extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
+ __attribute__ ((format (printf, 3, 0)));
extern int scnprintf(char * buf, size_t size, const char * fmt, ...)
__attribute__ ((format (printf, 3, 4)));
extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-03-14 1:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-13 14:06 [PATCH] Enable gcc warnings for vsprintf/vsnprintf with "format" attribute Marcelo Tosatti
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.