From: Guy Harris Date: Tue, 11 Dec 2018 05:53:58 +0000 (-0800) Subject: Try to squelch a warning about non-constant format strings. X-Git-Tag: tcpdump-4.99-bp~954 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/76ed0bb39212d964946a22380288c34adc09030f Try to squelch a warning about non-constant format strings. Declare the format-string argument to tok2strbuf(), tok2str(), bittok2str(), and bittok2str_nosep() as such, to see whether that gets MSVC not to complain - or if it just gets upset because there's no "..." argument list for it. --- diff --git a/netdissect.h b/netdissect.h index 0bacbfc7..58e860ff 100644 --- a/netdissect.h +++ b/netdissect.h @@ -139,13 +139,15 @@ struct tok { const char *s; /* string */ }; -extern const char *tok2strbuf(const struct tok *, const char *, u_int, - char *buf, size_t bufsize); +extern const char *tok2strbuf(const struct tok *, FORMAT_STRING(const char *), + u_int, char *buf, size_t bufsize); /* tok2str is deprecated */ -extern const char *tok2str(const struct tok *, const char *, u_int); -extern char *bittok2str(const struct tok *, const char *, u_int); -extern char *bittok2str_nosep(const struct tok *, const char *, u_int); +extern const char *tok2str(const struct tok *, FORMAT_STRING(const char *), + u_int); +extern char *bittok2str(const struct tok *, FORMAT_STRING(const char *), u_int); +extern char *bittok2str_nosep(const struct tok *, FORMAT_STRING(const char *), + u_int); /* Initialize netdissect. */ extern int nd_init(char *, size_t);