Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: Re: [Wireshark-dev] packet-ieee802154.c compilation error

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: "Maynard, Chris" <Christopher.Maynard@xxxxxxxxx>
Date: Tue, 2 Sep 2008 17:28:46 -0400

What about modifying the macro itself?

#define ieee802154_crc_tvb(tvb, offset)
((guint16)(crc16_ccitt_tvb_seed(tvb, offset, IEEE802154_CRC_SEED) ^
IEEE802154_CRC_XOROUT))


> -----Original Message-----
> From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-
> bounces@xxxxxxxxxxxxx] On Behalf Of Jaap Keuter
> Sent: Tuesday, September 02, 2008 5:23 PM
> To: Developer support list for Wireshark
> Subject: Re: [Wireshark-dev] packet-ieee802154.c compilation error
> 
> Hi Chris,
> 
> Yes, that is the one.
> And no, that typecast doesn't solve it.
> And yes, it does hide it from the larger scope, which is a bug IMHO.
> 
> Thanx,
> Jaap
> 
> Maynard, Chris wrote:
> > Jaap,
> > I assume this is the line it's complaining about?:
> >
> > fcs_ok = (fcs == ieee802154_crc_tvb(tvb,
> > tvb_reported_length(tvb)-IEEE802154_FCS_LEN));
> >
> > At first glance, there doesn't seem to be anything wrong with the
> > comparison since fcs is a guint16 and that's exactly what
> > crc16_ccitt_tvb_seed() returns; however, because the comparison is
> > actually the following:
> >
> > fcs_ok = (fcs == (crc16_ccitt_tvb_seed(tvb,
> > tvb_reported_length(tvb)-IEEE802154_FCS_LEN, IEEE802154_CRC_SEED) ^
> > IEEE802154_CRC_XOROUT));
> >
> > I think the compiler is interpreting (blah ^ IEEE802154_CRC_XOROUT)
...
> > where IEEE802154_CRC_XOROUT is defined as 0xFFFF ... as the
equivalent
> > of (~blah) and that's where your warning is coming from.
> >
> > What if you try the following?
> > fcs_ok = (fcs == (guint16)(ieee802154_crc_tvb(tvb,
> > tvb_reported_length(tvb)-IEEE802154_FCS_LEN)));
> >
> > - Chris
> > BTW: I ran lint on that file in case you want to have a look.  Lint
> > doesn't complain about that line exactly, but it might have some
other
> > things worth at least looking over.  For example, line 703 where
fcs_ok
> > is redeclared, but the value of fcs_ok, although assigned within the
> > if() scope is not actually visible outside of that scope; yet fcs_ok
is
> > referenced later on (line 746, ...).
> >
> >
> >> -----Original Message-----
> >> From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-
> >> bounces@xxxxxxxxxxxxx] On Behalf Of Jaap Keuter
> >> Sent: Tuesday, September 02, 2008 4:18 PM
> >> To: Developer support list for Wireshark
> >> Subject: [Wireshark-dev] packet-ieee802154.c compilation error
> >>
> >> Hi list,
> >>
> >> I'm running into this error for which I do not know the proper
> > solution:
> >> cc1: warnings being treated as errors
> >> packet-ieee802154.c: In function 'dissect_ieee802154_common':
> >> packet-ieee802154.c:709: error: comparison of promoted ~unsigned
with
> >> unsigned
> >> make[4]: *** [libdissectors_la-packet-ieee802154.lo] Error 1
> >>
> >> $ gcc -v
> >> Using built-in specs.
> >> Target: i486-linux-gnu
> >> Configured with: ../src/configure -v --with-pkgversion='Debian
> > 4.3.1-9'
> >> --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
> >> --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-
> >> shared
> >> --with-system-zlib --libexecdir=/usr/lib --without-included-gettext
> >> --enable-threads=posix --enable-nls --with-gxx-include-
> >> dir=/usr/include/c++/4.3
> >> --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
> >> --enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld
> >> --enable-checking=release --build=i486-linux-gnu
--host=i486-linux-gnu
> >> --target=i486-linux-gnu
> >> Thread model: posix
> >> gcc version 4.3.1 (Debian 4.3.1-9)
> >>
> >> Any hints are welcome.
> >>
> >> Thanx,
> >> Jaap
> >> _______________________________________________
> 
> _______________________________________________
> Wireshark-dev mailing list
> Wireshark-dev@xxxxxxxxxxxxx
> https://wireshark.org/mailman/listinfo/wireshark-dev
CONFIDENTIALITY NOTICE: The contents of this email are confidential
and for the exclusive use of the intended recipient. If you receive this
email in error, please delete it from your system immediately and 
notify us either by email, telephone or fax. You should not copy,
forward, or otherwise disclose the content of the email.


  • Follow-Ups:
    • Re: [Wireshark-dev] packet-ieee802154.c compilation error
      • From: Jaap Keuter
    • Re: [Wireshark-dev] packet-ieee802154.c compilation error
      • From: didier
  • References:
    • [Wireshark-dev] packet-ieee802154.c compilation error
      • From: Jaap Keuter
    • Re: [Wireshark-dev] packet-ieee802154.c compilation error
      • From: Maynard, Chris
    • Re: [Wireshark-dev] packet-ieee802154.c compilation error
      • From: Jaap Keuter
  • Prev by Date: Re: [Wireshark-dev] packet-ieee802154.c compilation error
  • Next by Date: Re: [Wireshark-dev] packet-ieee802154.c compilation error
  • Previous by thread: Re: [Wireshark-dev] packet-ieee802154.c compilation error
  • Next by thread: Re: [Wireshark-dev] packet-ieee802154.c compilation error
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation