Wireshark-dev: [Wireshark-dev] etype_vals[] compile error when adding new Ethernet dissector

Date: Wed, 25 Feb 2009 13:23:56 +0800

Hi,

 

I’m developing a new Ethernet dissector (as a plugin), but I’m stuck with a compiler error when I #include <epan/etypes.h>:

 

C:\wireshark\wireshark-1.0.5\epan/etypes.h(410) : error C2061: syntax error : identifier 'etype_vals'

C:\wireshark\wireshark-1.0.5\epan/etypes.h(410) : error C2059: syntax error : ';'

C:\wireshark\wireshark-1.0.5\epan/etypes.h(410) : error C3409: empty attribute block is not allowed

C:\wireshark\wireshark-1.0.5\epan/etypes.h(410) : error C2059: syntax error : ';'

 

Interestingly, this problem is predicted in the developer README:

“Don't use forward declarations of static arrays without a specified size … as some compilers will reject the first of those statements.”

 

I need etypes.h for my new Ethertype, and to call the ethertype() function for handing off to the next dissector. I’m reluctant to change established code in etypes.h and packet-ethertype.c because changes would surely affect other dissectors.

 

Has anyone else experienced this error, or can anyone think of a solution to this compilation problem?

 

Kind regards,
Pat

 

-----------------------------------------

Patrick Horgan,

Software Developer,

Agilent DNPL Melbourne

-----------------------------------------