Wireshark-bugs: [Wireshark-bugs] [Bug 9684] New: C Arrays format should escape comments

Date: Tue, 21 Jan 2014 20:44:49 +0000
Bug ID 9684
Summary C Arrays format should escape comments
Classification Unclassified
Product Wireshark
Version 1.10.5
Hardware x86-64
OS Mac OS X 10.9
Status UNCONFIRMED
Severity Trivial
Priority Low
Component Capture file support (libwiretap)
Assignee [email protected]
Reporter [email protected]

Build Information:
Version 1.10.5 (SVNRev 54262 from /trunk-1.10)

Copyright 1998-2013 Gerald Combs <[email protected]> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (64-bit) with GTK+ 2.24.17, with Cairo 1.10.2, with Pango 1.30.1, with
GLib 2.36.0, with libpcap, with libz 1.2.3, without POSIX capabilities, without
libnl, with SMI 0.4.8, without c-ares, without ADNS, with Lua 5.1, without
Python, with GnuTLS 2.12.19, with Gcrypt 1.5.0, with MIT Kerberos, with GeoIP,
with PortAudio V19-devel (built Jul 16 2013 19:05:52), with AirPcap.

Running on Mac OS X 10.9.1, build 13B42 (Darwin 13.0.0), with locale .UTF-8,
with libpcap version 1.3.0 - Apple version 41, with libz 1.2.5, GnuTLS 2.12.19,
Gcrypt 1.5.0, without AirPcap.
      Intel(R) Core(TM) i7-2860QM CPU @ 2.50GHz

Built using llvm-gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build
2336.9.00).

Wireshark is Open Source Software released under the GNU General Public
License.

Check the man page and http://www.wireshark.org for more information.
--
This one is a little comical. I exported a whole mess of UDP packets to a C
arrays format file, which wound up being about a gig in size. Of course, given
the infallibility of Murphy's law, there were some block comment delimiters in
the comments, which made gcc choke:

> : gcc dump.c
>  In file included from dump.c:1:
> ./dump.h:5208063:52: warning: '/*' within block comment [-Wcomment]
> 0x2f, 0x2a, 0xc0, 0xa8, 0x01, 0x01, 0xc0, 0xa8, /* /*...... */
>                                                    ^
> ./dump.h:8470140:54: error: expected _expression_
> 0x2a, 0x2f, 0xc0, 0xa8, 0x01, 0x01, 0xc0, 0xa8, /* */...... */

If ANSI-C compatibility isn't important, you could switch to '//' single line
comments, or do some kind of escaping.

PS I love me some wireshark!


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