ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 9072] Enhancement of the packet-mq dissector (WMQ 7.1-7.5)

Date: Sun, 15 Sep 2013 01:37:41 +0000

Comment # 36 on bug 9072 from
Ok, I'm personally happy with this version of the patch, but my compiler isn't
:)

For the "unused parameter" issues, you can either remove the parameter or mark
it with _U_ (if you can't remove it, or think it might be useful later). For
example:

int myfunc(int param1, int unusedParam _U_)

My compiler output is:

packet-mq-pcf.c: In function 'dissect_mqpcf_parm_int':
packet-mq-pcf.c:91:57: error: unused parameter 'pinfo'
[-Werror=unused-parameter]
 void dissect_mqpcf_parm_int(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*tree, guint offset,guint uPrm,guint uVal,int hfindex)
                                                         ^
packet-mq-pcf.c: In function 'dissect_mqpcf_parm':
packet-mq-pcf.c:200:11: error: declaration of 'i' shadows a previous local
[-Werror=shadow]
     guint i;
           ^
packet-mq-pcf.c:113:8: error: shadowed declaration is here [-Werror=shadow]
  guint i=0;
        ^
packet-mq-pcf.c:222:13: error: declaration of 'i' shadows a previous local
[-Werror=shadow]
     guint   i;
             ^
packet-mq-pcf.c:113:8: error: shadowed declaration is here [-Werror=shadow]
  guint i=0;
        ^
packet-mq-pcf.c:303:6: error: format '%x' expects argument of type 'unsigned
int', but argument 7 has type 'guint64' [-Werror=format=]
      strPrm, uVal64, uVal64);
      ^
packet-mq-pcf.c:318:11: error: declaration of 'i' shadows a previous local
[-Werror=shadow]
     guint i;
           ^
packet-mq-pcf.c:113:8: error: shadowed declaration is here [-Werror=shadow]
  guint i=0;
        ^
packet-mq.c: In function 'dissect_mq_MQMO':
packet-mq.c:1207:57: error: unused parameter 'pinfo' [-Werror=unused-parameter]
 static gint dissect_mq_MQMO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                         ^
packet-mq.c:1207:104: error: unused parameter 'string_rep'
[-Werror=unused-parameter]
 static gint dissect_mq_MQMO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                                               
                        ^
packet-mq.c: In function 'dissect_mq_MQGMO':
packet-mq.c:1234:58: error: unused parameter 'pinfo' [-Werror=unused-parameter]
 static gint dissect_mq_MQGMO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                          ^
packet-mq.c:1234:105: error: unused parameter 'string_rep'
[-Werror=unused-parameter]
 static gint dissect_mq_MQGMO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                                               
                         ^
packet-mq.c: In function 'dissect_mq_MQPMO':
packet-mq.c:1283:58: error: unused parameter 'pinfo' [-Werror=unused-parameter]
 static gint dissect_mq_MQPMO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                          ^
packet-mq.c:1283:105: error: unused parameter 'string_rep'
[-Werror=unused-parameter]
 static gint dissect_mq_MQPMO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                                               
                         ^
packet-mq.c: In function 'dissect_mq_MQOO':
packet-mq.c:1326:57: error: unused parameter 'pinfo' [-Werror=unused-parameter]
 static gint dissect_mq_MQOO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                         ^
packet-mq.c:1326:104: error: unused parameter 'string_rep'
[-Werror=unused-parameter]
 static gint dissect_mq_MQOO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                                               
                        ^
packet-mq.c: In function 'dissect_mq_MQCO':
packet-mq.c:1368:57: error: unused parameter 'pinfo' [-Werror=unused-parameter]
 static gint dissect_mq_MQCO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                         ^
packet-mq.c:1368:104: error: unused parameter 'string_rep'
[-Werror=unused-parameter]
 static gint dissect_mq_MQCO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                                               
                        ^
packet-mq.c:1368:133: error: unused parameter 'ett_subtree'
[-Werror=unused-parameter]
 static gint dissect_mq_MQCO(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*mq_tree, gint int_rep, gint string_rep, gint offset,gint ett_subtree)
                                                                               
                                                     ^
packet-mq.c: In function 'dissect_mq_charv':
packet-mq.c:1409:79: error: pointer type mismatch in conditional _expression_
[-Werror]
  ti = proto_tree_add_text(tree, tvb, offset, iSize, "%s -
%s",pStr,(lStr)?sStr:"[Empty]");
                                                                              
^
packet-mq.c:1409:2: error: format '%s' expects argument of type 'char *', but
argument 7 has type 'void *' [-Werror=format=]
  ti = proto_tree_add_text(tree, tvb, offset, iSize, "%s -
%s",pStr,(lStr)?sStr:"[Empty]");
  ^
packet-mq.c:1392:58: error: unused parameter 'pinfo' [-Werror=unused-parameter]
 static gint dissect_mq_charv(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*tree, gint int_rep, gint string_rep, gint offset,gint iSize,const gint
idx,guint8 *pStr)
                                                          ^
packet-mq.c: In function 'dissect_mq_od':
packet-mq.c:1745:6: error: passing argument 9 of 'dissect_mq_charv' discards
'const' qualifier from pointer target type [-Werror]
     
dissect_mq_charv(tvb,pinfo,mq_tree,int_rep,string_rep,offset+336,20,ett_mq_od_objstr,"Object
string");
      ^
packet-mq.c:1392:13: note: expected 'guint8 *' but argument is of type 'const
char *'
 static gint dissect_mq_charv(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*tree, gint int_rep, gint string_rep, gint offset,gint iSize,const gint
idx,guint8 *pStr)
             ^
packet-mq.c:1746:6: error: passing argument 9 of 'dissect_mq_charv' discards
'const' qualifier from pointer target type [-Werror]
     
dissect_mq_charv(tvb,pinfo,mq_tree,int_rep,string_rep,offset+356,20,ett_mq_od_selstr,"Selection
string");
      ^
packet-mq.c:1392:13: note: expected 'guint8 *' but argument is of type 'const
char *'
 static gint dissect_mq_charv(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*tree, gint int_rep, gint string_rep, gint offset,gint iSize,const gint
idx,guint8 *pStr)
             ^
packet-mq.c:1747:6: error: passing argument 9 of 'dissect_mq_charv' discards
'const' qualifier from pointer target type [-Werror]
     
dissect_mq_charv(tvb,pinfo,mq_tree,int_rep,string_rep,offset+376,20,ett_mq_od_resobjstr,"Resolved
object string");
      ^
packet-mq.c:1392:13: note: expected 'guint8 *' but argument is of type 'const
char *'
 static gint dissect_mq_charv(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*tree, gint int_rep, gint string_rep, gint offset,gint iSize,const gint
idx,guint8 *pStr)
             ^
packet-mq.c: In function 'dissect_mq_id':
packet-mq.c:1873:17: error: declaration of 'ti' shadows a previous local
[-Werror=shadow]
     proto_item *ti = proto_tree_add_item(mq_tree, hf_mq_id_flags, tvb, offset
+ 5, 1, ENC_BIG_ENDIAN);
                 ^
packet-mq.c:1863:16: error: shadowed declaration is here [-Werror=shadow]
    proto_item *ti = proto_tree_add_text(mqroot_tree, tvb, offset, iSize,
MQ_TEXT_ID);
                ^
packet-mq.c:1891:17: error: declaration of 'ti' shadows a previous local
[-Werror=shadow]
     proto_item *ti = proto_tree_add_item(mq_tree, hf_mq_id_ieflags, tvb,
offset + 7, 1, int_rep);
                 ^
packet-mq.c:1863:16: error: shadowed declaration is here [-Werror=shadow]
    proto_item *ti = proto_tree_add_text(mqroot_tree, tvb, offset, iSize,
MQ_TEXT_ID);
                ^
packet-mq.c: In function 'dissect_mq_pdu':
packet-mq.c:2961:14: error: declaration of 'iSizeMD' shadows a previous local
[-Werror=shadow]
         gint iSizeMD = 0;
              ^
packet-mq.c:2043:7: error: shadowed declaration is here [-Werror=shadow]
  gint iSizeMD = 0;
       ^
packet-mq.c: In function 'reassemble_mq':
packet-mq.c:3273:4: error: comparison is always false due to limited range of
data type [-Werror=type-limits]
    if (iOpcd > 0x80 && !(bSeg1st && bSegLst) || iOpcd==MQ_TST_ASYNC_MESSAGE)
    ^
packet-mq.c:3273:21: error: suggest parentheses around '&&' within '||'
[-Werror=parentheses]
    if (iOpcd > 0x80 && !(bSeg1st && bSegLst) || iOpcd==MQ_TST_ASYNC_MESSAGE)
                     ^
packet-mq.c: At top level:
packet-mq.c:225:12: error: 'hf_mq_close_options_IMMEDIATE$NONE' defined but not
used [-Werror=unused-variable]
 static int hf_mq_close_options_IMMEDIATE$NONE         = -1;
            ^
packet-mq.c:549:13: error: 'ett_mq_close' defined but not used
[-Werror=unused-variable]
 static gint ett_mq_close = -1;
             ^
packet-mq.c:567:13: error: 'ett_mq_gmo_option' defined but not used
[-Werror=unused-variable]
 static gint ett_mq_gmo_option = -1;
             ^


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