This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

how to modify the warning level of vs2008

0

Hi guys,

Some warnings displayed when I compiled the Wireshark source code after modifying some code. Please see below:

packet-ethertype.c(211) : error C2220: warning treated as error - no 'object' file generated
packet-ethertype.c(211) : warning C4029: declared formal parameter list different from definition
packet-eth.c(434) : error C2220: warning treated as error - no 'object' file generated
packet-eth.c(434) : warning C4020: 'ethertype' : too many actual parameters
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

I've no idea where the problem is. I searched Google, and someone said the warning level of my VS2008 shouldn't be so high, but I didn't find anywhere how to modify the warning level. Anyone know how to modify this?

Thanks in advance!

Sam

asked 02 Oct '11, 04:17

Sam's gravatar image

Sam
517914
accept rate: 0%

edited 02 Oct '11, 15:47

helloworld's gravatar image

helloworld
3.1k42041


One Answer:

2
packet-ethertype.c(211) : error C2220: warning treated as error - no 'object' file generated
packet-ethertype.c(211) : warning C4029: declared formal parameter list different from definition
packet-eth.c(434) : error C2220: warning treated as error - no 'object' file generated
packet-eth.c(434) : warning C4020: 'ethertype' : too many actual parameters

The above two warnings need to be fixed. The messages should be self-explanatory.

Did you make changes to the definition of ethertype in packet-ethertype.c ?

If yes, your changes need work to solve the errors.

If not, does your Wireshark source w/o any of your changes compile w/o error ?

answered 02 Oct '11, 06:03

Bill%20Meier's gravatar image

Bill Meier ♦♦
3.2k1850
accept rate: 17%

edited 02 Oct '11, 06:21

thanks, Bill. I just have a parameter/vtime_id added in packet-ethertype.c as below:

ethertype(guint16 etype, tvbuff_t tvb, int offset_after_etype, packet_info pinfo, proto_tree tree, proto_tree fh_tree, int etype_id, int vtime_id, int trailer_id, int fcs_len)

Does this have some problem? anywhere else need to changed if theparameter/vtime_id added? BTW, why I added this parameter/vtime_id? because I have some bytes in the trailer need be extracted. For expample, if the trailer is: 112233445566778899, I want the first four bytes need be recongnized as 'vtime', and the last five bytes recognized as 'trailer'. Do you have any idea? Thanks again.

(02 Oct '11, 08:18) Sam
1

Firstly you should have made your second entry a comment to Bill's answer, not an "answer" of your own.

Secondly, if you modify the function definition you must modify any corresponding function declaration, i.e. in epan/packet.h. This is the cause of the 'packet-ethertype.c(211) : warning C4029: declared formal parameter list different from definition' warning.

Thirdly, any code that calls your modified function must also be modified to match the modified function declaration. This is the cause of the 'packet-eth.c(434) : warning C4020: 'ethertype' : too many actual parameters' warning.

(02 Oct '11, 13:19) grahamb ♦

(converted your "answer" to a "comment", please see the FAQ for details)

(02 Oct '11, 14:55) SYN-bit ♦♦

First line, I modified the epan/packet.h and then compiled success follow your tips. thank you, Grahamb.

But what's meaning about the word 'w/o' or w/o error in previous comment from Bill?

Sam

(02 Oct '11, 19:56) Sam

w/o is an abbreviation for "without".

(02 Oct '11, 20:04) helloworld

Thank you, helloworld. Thank you all for help. My reply is wireshark source have no any errors. And I have another question need your help.

I use the function 'proto_tree_add_item' to put some bytes to the 'vtime' item, but the bytes are just hex code, but its readability is very poor, I have to convert these bytes to a good readability format.

For example: The 'vtime' item display '64000064', and I need convert the '64000064' to '100.0.0.100' and displayed in the 'vtime' item. how to do it? use the 'vtime_id' like the 'trailer_id'?

thanks again.

Sam

(03 Oct '11, 19:36) Sam
showing 5 of 6 show 1 more comments