summaryrefslogtreecommitdiff
path: root/wsutil/ws_printf.h
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-07-24 08:53:39 -0400
committerAnders Broman <a.broman58@gmail.com>2016-07-25 04:26:50 +0000
commit1da1f945e2988080add4923dc2021753e3b2f7c1 (patch)
tree2839b66064e34ba99a6d031778330f20497b5e93 /wsutil/ws_printf.h
parentee7f9c33f63532bc69899a0750177756be53c0c1 (diff)
downloadwireshark-1da1f945e2988080add4923dc2021753e3b2f7c1.tar.gz
Fix checkAPI.pl warnings about printf
Many of the complaints from checkAPI.pl for use of printf are when its embedded in an #ifdef and checkAPI isn't smart enough to figure that out. The other (non-ifdef) use is dumping internal structures (which is a type of debug functionality) Add a "ws_debug_printf" macro for printf to pacify the warnings. Change-Id: I63610e1adbbaf2feffb4ec9d4f817247d833f7fd Reviewed-on: https://code.wireshark.org/review/16623 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wsutil/ws_printf.h')
-rw-r--r--wsutil/ws_printf.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/wsutil/ws_printf.h b/wsutil/ws_printf.h
index 1ee3bf69e6..d996d01c5e 100644
--- a/wsutil/ws_printf.h
+++ b/wsutil/ws_printf.h
@@ -93,6 +93,14 @@ ws_snprintf(char *buffer, size_t size_of_buffer, const char * format, ...) {
va_end(argptr);
}
+/* This is intended to fool checkAPIs.pl for places that have "debugging"
+(using printf) usually wrapped in an #ifdef, but checkAPIs.pl isn't smart
+enough to figure that out.
+Dissectors should still try to use proto_tree_add_debug_text when the
+debugging context has a protocol tree.
+*/
+#define ws_debug_printf printf
+
#ifdef __cplusplus
}
#endif /* __cplusplus */