Wireshark-dev: [Wireshark-dev] rev30840 compilation error: packet-6lowpan.c:1617: error: sugges
From: yami <yamisoe@xxxxxxxxx>
Date: Fri, 6 Nov 2009 07:48:13 +0800
Hi dev,

Has anyone encounter such a compilation warning (treated as error)?
The code is:

        switch (udp_flags & (LOWPAN_NHC_UDP_SRCPORT | LOWPAN_NHC_UDP_DSTPORT)) {
            case (LOWPAN_NHC_UDP_SRCPORT | LOWPAN_NHC_UDP_DSTPORT):
                udp.src_port = LOWPAN_PORT_12BIT_OFFSET + (tvb_get_guint8(tvb, offset) >> 4);
                udp.dst_port = LOWPAN_PORT_12BIT_OFFSET + tvb_get_guint8(tvb, offset) & 0x0f;
                src_bitlen = 4;
                dst_bitlen = 4;
                break;

I'm not familiar with this code, but it seems that we need parenthesizes around 'tvb_get_guint8(tvb, offset) & 0x0f'?
Or around '+' to please the compiler?

My gcc version:

yami@yami-workshop:~/project/wsclean/wireshark$ gcc --version
gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.