Wireshark-bugs: [Wireshark-bugs] [Bug 8832] patch: add support for OSD-2/3 in the SCSI dissector
Date: Fri, 28 Jun 2013 02:52:42 +0000

Comment # 6 on bug 8832 from
My version of GCC complains:

packet-scsi-osd.c: In function 'dissect_osd_attributes_list':
packet-scsi-osd.c:375:30: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
  while( (offset-start_offset)<(length+4) ){
                              ^
packet-scsi-osd.c: In function 'dissect_osd2_attribute_list_entry':
packet-scsi-osd.c:482:29: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
  if (offset+attribute_length<end) return end;
                             ^
packet-scsi-osd.c: In function 'dissect_osd_offset':
packet-scsi-osd.c:581:5: error: comparison is always false due to limited range
of data type [-Werror=type-limits]
     if (exponent<=-6&&mantissa!=0xFFFFFFF) {
     ^
packet-scsi-osd.c:586:6: error: implicit declaration of function
'expert_add_info_format' [-Werror=implicit-function-declaration]
      expert_add_info_format(pinfo, item, PI_UNDECODED, severity, "Invalid
offset exponent");
      ^
packet-scsi-osd.c: In function 'dissect_osd_attribute_parameters':
packet-scsi-osd.c:612:2: error: ISO C90 forbids mixed declarations and code
[-Werror=declaration-after-statement]
  gboolean osd2;
  ^
packet-scsi-osd.c: At top level:
packet-scsi-osd.c:281:1: error: 'dissect_osd_immed_tr' defined but not used
[-Werror=unused-function]
 dissect_osd_immed_tr(tvbuff_t *tvb, int offset, proto_tree *tree)
 ^

Also:
- You add one hf_scsi_osd2_ variable but several others that are just prefixed
hf_scsi_osd_ - should the others also be osd2?

- For error conditions where you currently proto_tree_add_text, please use our
expert information API instead (you don't have to update existing calls if you
don't want to, but new ones should all use the correct API). Also be sure to
use the *new* expert info API (there are two now, I know it's sort of
confusing) where you register your expert information similarly to how you
register your fields.

- There are a few places where you put existing code inside an if statement but
don't indent the existing code so it ends up looking like:

if (foo) {
    new code
}
else {
old code
}

Please indent the old code as well.

Thanks,
Evan


You are receiving this mail because:
  • You are watching all bug changes.