Skip to contentSkip to conversation

add netfilter gcc printf format checking

PATCH Applied Helge Deller 2 participants 5 messages Jan 6, 2008 – Jan 20, 2008

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

PATCH 1/1 add netfilter gcc printf format checking

[PATCH] add netfilter gcc printf format checking

include/linux/netfilter.h +1 -1
index 16adac6..a335bfc 100644
@@ -181,7 +181,7 @@ void nf_log_packet(int pf,
 		   const struct net_device *in,
 		   const struct net_device *out,
 		   struct nf_loginfo *li,
-		   const char *fmt, ...);
+		   const char *fmt, ...) __printf(7,8);
 
 int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
 		 struct net_device *indev, struct net_device *outdev,
#1 lore raw

updated patch below
=================

[PATCH] add netfilter gcc printf format checking

include/linux/netfilter.h +1 -1
index 16adac6..5d9ecdc 100644
@@ -181,7 +181,7 @@ void nf_log_packet(int pf,
 		   const struct net_device *in,
 		   const struct net_device *out,
 		   struct nf_loginfo *li,
-		   const char *fmt, ...);
+		   const char *fmt, ...) __attribute__ ((format(printf,7,8)));
 
 int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
 		 struct net_device *indev, struct net_device *outdev,
#2 lore raw
Quoted 4 lines · Helge Deller

updated patch below
=================

[PATCH] add netfilter gcc printf format checking

This does not apply to the current tree because the logging functions have been move to a seperate header. Could you rediff against

git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25.git

please and resend? Ideally wait until my last batch of patches hits that tree so you don't run into new conflicts.

#3 lore raw

updated patch against net-2.6.25 git tree below
=============================

[PATCH] add netfilter gcc printf format checking

include/net/netfilter/nf_log.h +1 -1
index 037e824..8c6b5ae 100644
@@ -54,6 +54,6 @@ void nf_log_packet(int pf,
 		   const struct net_device *in,
 		   const struct net_device *out,
 		   const struct nf_loginfo *li,
-		   const char *fmt, ...);
+		   const char *fmt, ...) __attribute__ ((format(printf,7,8)));
 
 #endif /* _NF_LOG_H */
#4 lore raw
Quoted 4 lines · Helge Deller

updated patch against net-2.6.25 git tree below
=============================

[PATCH] add netfilter gcc printf format checking

Applied, thanks Helge.