Skip to contentSkip to conversation

net: sctp: attribute printl with __printf for gcc fmt checks

PATCH Applied Daniel Borkmann 2 participants 2 messages May 1, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sctp: attribute printl with __printf for gcc fmt checks

Let GCC check for format string errors in sctp's probe printl function. This patch fixes the warning when compiled with W=1:

net/sctp/probe.c:73:2: warning: function might be possible candidate for 'gnu_printf' format attribute [-Wmissing-format-attribute]

---
 net/sctp/probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/probe.c +1 -1
index ad0dba8..e62c225 100644
@@ -63,7 +63,7 @@ static struct {
 	struct timespec	  tstart;
 } sctpw;
 
-static void printl(const char *fmt, ...)
+static __printf(1, 2) void printl(const char *fmt, ...)
 {
 	va_list args;
 	int len;
Signature · 1 line
1.7.11.7
maintainer Applied
#1 lore raw

From: Daniel Borkmann <[email protected]>
Date: Wed, 1 May 2013 14:59:23 +0200

Quoted 7 lines

Let GCC check for format string errors in sctp's probe printl function. This patch fixes the warning when compiled with W=1:

net/sctp/probe.c:73:2: warning: function might be possible candidate for 'gnu_printf' format attribute [-Wmissing-format-attribute]

Applied.