Wireshark-dev: [Wireshark-dev] Testcompiling doc/packet-PROTOABBREV.c
From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Sat, 21 Dec 2013 10:47:55 +0100
In order to make sure we have a "current" sample file it might be
helpful to be able to actually compile our sample dissector. I did
a few small changes to (currently manually) achieve this.

Here's how to and the result:

jmayer@egg:~/work/wireshark/svn/trunk/doc> gcc -I../../build/qt-gtk3/ -I/usr/include/glib-2.0/ -I/usr/lib/glib-2.0/include/  -I.. -I../epan -DFIELDTYPE=FT_BYTES -DFIELDDISPLAY=BASE_NONE -DFIELDCONVERT=NULL -DBITMASK=0x0 -DPI_SEVERITY=PI_UNDECODED -DPI_GROUP=PI_NOTE -DENC_xxx=ENC_BIG_ENDIAN -DTEST_HEURISTICS=0 -DTEST_EXPERT_condition=0 -o packet-PROTOABBREV.out packet-PROTOABBREV.c
packet-PROTOABBREV.c: In function ‘proto_register_PROTOABBREV’:
packet-PROTOABBREV.c:252:58: error: expected expression before ‘const’
     PROTOABBREV_module = prefs_register_protocol_subtree(const char *subtree,
                                                          ^
packet-PROTOABBREV.c:253:13: error: too few arguments to function ‘prefs_register_protocol_subtree’
             proto_PROTOABBREV, proto_reg_handoff_PROTOABBREV);
             ^
In file included from packet-PROTOABBREV.c:39:0:
../epan/prefs.h:301:25: note: declared here
 WS_DLL_PUBLIC module_t *prefs_register_protocol_subtree(const char *subtree, int id,
                         ^
jmayer@egg:~/work/wireshark/svn/trunk/doc> gcc -I../../build/qt-gtk3/ -I/usr/include/glib-2.0/ -I/usr/lib/glib-2.0/include/  -I.. -I../epan -DFIELDTYPE=FT_BYTES -DFIELDDISPLAY=BASE_NONE -DFIELDCONVERT=NULL -DBITMASK=0x0 -DPI_SEVERITY=PI_UNDECODED -DPI_GROUP=PI_NOTE -DENC_xxx=ENC_BIG_ENDIAN -DTEST_HEURISTICS=0 -DTEST_EXPERT_condition=0 -o packet-PROTOABBREV.out packet-PROTOABBREV.c
packet-PROTOABBREV.c: In function ‘proto_register_PROTOABBREV’:
packet-PROTOABBREV.c:252:58: error: expected expression before ‘const’
     PROTOABBREV_module = prefs_register_protocol_subtree(const char *subtree,
                                                          ^
packet-PROTOABBREV.c:253:13: error: too few arguments to function ‘prefs_register_protocol_subtree’
             proto_PROTOABBREV, proto_reg_handoff_PROTOABBREV);
             ^
In file included from packet-PROTOABBREV.c:39:0:
../epan/prefs.h:301:25: note: declared here
 WS_DLL_PUBLIC module_t *prefs_register_protocol_subtree(const char *subtree, int id,
                         ^

Wouldi t make sense to automate this, i.e. include this file into the compile
process?

Ciao
    Jörg
-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.