]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't use __attribute__((format)) if it's not supported.
authorGuy Harris <[email protected]>
Thu, 28 Nov 2013 19:49:44 +0000 (11:49 -0800)
committerGuy Harris <[email protected]>
Thu, 28 Nov 2013 19:49:44 +0000 (11:49 -0800)
Also, *do* use it, if supported, for ndo_warning().

tcpdump.c

index 739f9c8ae859296a3348a03659fe3b3016a2b75b..9e96daf9c33346994515115e6775d09fc5e6ce62 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -129,8 +129,16 @@ static void dump_packet_and_trunc(u_char *, const struct pcap_pkthdr *, const u_
 static void dump_packet(u_char *, const struct pcap_pkthdr *, const u_char *);
 static void droproot(const char *, const char *);
 static void ndo_error(netdissect_options *ndo, const char *fmt, ...)
-     __attribute__ ((noreturn, format (printf, 2, 3)));
-static void ndo_warning(netdissect_options *ndo, const char *fmt, ...);
+     __attribute__((noreturn))
+#ifdef __ATTRIBUTE___FORMAT_OK
+     __attribute__((format (printf, 2, 3)))
+#endif /* __ATTRIBUTE___FORMAT_OK */
+    ;
+static void ndo_warning(netdissect_options *ndo, const char *fmt, ...)
+#ifdef __ATTRIBUTE___FORMAT_OK
+     __attribute__((format (printf, 2, 3)))
+#endif /* __ATTRIBUTE___FORMAT_OK */
+    ;
 
 #ifdef SIGNAL_REQ_INFO
 RETSIGTYPE requestinfo(int);