Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] rev30840 compilation error: packet-6lowpan.c:1617: error: su

From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Fri, 06 Nov 2009 08:10:06 +0100
Hi,

Didn't spot it at first. Fixed in revision 30842.

Thanx,
Jaap

yami wrote:
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.