summaryrefslogtreecommitdiff
path: root/doc/README.developer
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-05-26 02:21:23 +0000
committerGuy Harris <guy@alum.mit.edu>2010-05-26 02:21:23 +0000
commit7da29cfe69d37b0e601d13546fd667739f581dbe (patch)
tree42d7e570b8b193956a85f59fa9aa846d61f65deb /doc/README.developer
parentebc3739570932684456bd2be47d4c901e6c09535 (diff)
downloadwireshark-7da29cfe69d37b0e601d13546fd667739f581dbe.tar.gz
Put in a warning about the <stdarg.h> problem that I just found and
fixed in one place (and am now fixing in some other places). svn path=/trunk/; revision=32962
Diffstat (limited to 'doc/README.developer')
-rw-r--r--doc/README.developer20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/README.developer b/doc/README.developer
index d62c64eb50..bef14ae17f 100644
--- a/doc/README.developer
+++ b/doc/README.developer
@@ -193,6 +193,26 @@ rather than
11644473600ULL
+Don't assume that you can scan through a va_list initialized by va_start
+more than once without closing it with va_end and re-initalizing it with
+va_start. This applies even if you're not scanning through it yourself,
+but are calling a routine that scans through it, such as vfprintf() or
+one of the routines in Wireshark that takes a format and a va_list as an
+argument. You must do
+
+ va_start(ap, format);
+ call_routine1(xxx, format, ap);
+ va_end(ap);
+ va_start(ap, format);
+ call_routine2(xxx, format, ap);
+ va_end(ap);
+
+rather
+ va_start(ap, format);
+ call_routine1(xxx, format, ap);
+ call_routine2(xxx, format, ap);
+ va_end(ap);
+
Don't use a label without a statement following it. For example,
something such as