aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-10-06 17:52:57 +0000
committerGuy Harris <guy@alum.mit.edu>2004-10-06 17:52:57 +0000
commit5a244d166b223e904fdea142a495eba38f9fcb28 (patch)
tree4d984a3eec1ecbd808fec8ef986e8492a1d26360 /doc
parent8b8e67ccbe5228b5ba8a682fe3e0bcec9daf5403 (diff)
Note that variadic macros shouldn't be used.
svn path=/trunk/; revision=12224
Diffstat (limited to 'doc')
-rw-r--r--doc/README.developer17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/README.developer b/doc/README.developer
index cbca41f014..300be484f4 100644
--- a/doc/README.developer
+++ b/doc/README.developer
@@ -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.