Note that variadic macros shouldn't be used.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 6 Oct 2004 17:52:57 +0000 (17:52 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 6 Oct 2004 17:52:57 +0000 (17:52 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12224 f5534014-38df-0310-8fa8-9805f1628bb7

doc/README.developer

index cbca41f0148e01346bf83777833ce80695a6d7ba..300be484f492e0e66f13b4a65a6d7c6e7af1e7d4 100644 (file)
@@ -241,6 +241,23 @@ to implement it.  Use something like
 
 instead.
 
+Don't use "variadic macros", such as
+
+       #define DBG(format, args...)    fprintf(stderr, format, ## args)
+
+as not all C compilers support them.  Use macros that take a fixed
+number of arguments, such as
+
+       #define DBG0(format)            fprintf(stderr, format)
+       #define DBG1(format, arg1)      fprintf(stderr, format, arg1)
+       #define DBG2(format, arg1, arg2) fprintf(stderr, format, arg1, arg2)
+
+               ...
+
+or something such as
+
+       #define DBG(args)               printf args
+
 snprintf() -> g_snprintf()
 snprintf() is not available on all platforms, so it's a good idea to use the 
 g_snprintf() function declared by <glib.h> instead.