From 8f3f19975d763de647e751256c7c51cc57d40b03 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 7 Nov 2006 09:12:30 +0000 Subject: [PATCH] Add Yet Another Portability Recommendation. svn path=/trunk/; revision=19855 --- doc/README.developer | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/README.developer b/doc/README.developer index 1cc73f4b46..14d0873fe3 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -201,6 +201,14 @@ Wireshark is running. Use the tvbuff routines to extract individual items from the packet, or use "proto_tree_add_item()" and let it extract the items for you. +Don't use structures that overlay packet data, or into which you copy +packet data; the C programming language does not guarantee any +particular alignment of fields within a structure, and even the +extensions that try to guarantee that are compiler-specific and not +necessarily supported by all compilers used to build Wireshark. Using +bitfields in those structures are even worse; the order of bitfields +is not guaranteed. + Don't use "ntohs()", "ntohl()", "htons()", or "htonl()"; the header files required to define or declare them differ between platforms, and you might be able to get away with not including the appropriate header