Put in a warning about the <stdarg.h> problem that I just found and
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 26 May 2010 02:21:23 +0000 (02:21 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 26 May 2010 02:21:23 +0000 (02:21 +0000)
fixed in one place (and am now fixing in some other places).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32962 f5534014-38df-0310-8fa8-9805f1628bb7

doc/README.developer

index d62c64eb500cbadc236847b4ecb0a96641a085c4..bef14ae17f5b064f9b8911c248953cfb8a25d14d 100644 (file)
@@ -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