Wireshark-dev: Re: [Wireshark-dev] buildbot failure in Wireshark (development) on OSX
From: Graham Bloice <graham.bloice@xxxxxxxxxxxxx>
Date: Fri, 14 Jan 2011 13:11:15 +0000
On 14/01/2011 12:24, buildbot-no-reply@xxxxxxxxxxxxx wrote:
The Buildbot has detected a new failure of OSX-10.6-x64 on Wireshark (development).
Full details are available at:
 http://buildbot.wireshark.org/trunk/builders/OSX-10.6-x64/builds/1636

Buildbot URL: http://buildbot.wireshark.org/trunk/

Buildslave for this Build: osx-10.6-x64

Build Reason: 
Build Source Stamp: 35533
Blamelist: grahamb

BUILD FAILED: failed compile


Any idea why the OSX compilers are complaining about this code in packet-dnp.c:

 if (!header_only || al_objq_index > 0) {
    start_offset = offset;
    for (item_num = 0; item_num < num_items; item_num++)
    {
      /* Create Point item and Process Index */
      if (AL_OBJQL_IDX_NI <= al_objq_index && al_objq_index <= AL_OBJQL_IDX_4O)   <---------- Error here
        point_item = proto_tree_add_text(object_tree, tvb, offset, -1, "Point Number");
      else
        point_item = proto_tree_add_text(object_tree, tvb, offset, -1, "Object: Size");
      point_tree = proto_item_add_subtree(point_item, ett_dnp3_al_obj_point);

      data_pos = offset;
      indexbytes = dnp3_al_obj_procindex(tvb, offset, al_objq_index, &al_ptaddr, point_tree);
      proto_item_append_text(point_item, " %u", al_ptaddr);
      proto_item_set_len(point_item, indexbytes);
      data_pos += indexbytes;

      if (!header_only || (AL_OBJQL_IDX_1OS <= al_objq_index && al_objq_index <= AL_OBJQL_IDX_4OS)) {
     
The reported error is:
packet-dnp.c: In function 'dnp3_al_process_object':
packet-dnp.c:1566: warning: comparison is always true due to limited range of data type
The variable (al_objq_index) is three bits so has a value between 0 and 7 and the constants are enumerations of the values.  AL_OBJQL_IDX_NI is 0 and AL_OBJQL_IDX_4O is 3.  I suspect that the following if() might also error out as it just checks for a different range of values (4-6).

-- 
Regards,

Graham Bloice