Wireshark mailing list archives

Re: [Wireshark-commits] rev 50489: /trunk/epan/ /trunk/epan/: tvbuff-int.h tvbuff.c


From: Jakub Zawadzki <darkjames-ws () darkjames pl>
Date: Thu, 11 Jul 2013 06:46:49 +0200

Hi,

On Wed, Jul 10, 2013 at 06:04:13PM -0700, Guy Harris wrote:
On Jul 10, 2013, at 12:08 PM, darkjames () wireshark org wrote:

http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=50489

User: darkjames
Date: 2013/07/10 12:08 PM

Log:
tvbuff: allow tvb-implementations using their own structure (it's fine as long as first member of struct is tvbuff)

Move some stuff outside tvbuff struct.

The current version of the code is getting warnings such as

Errors even.

../../epan/tvbuff.c:54:29: error: uninitialized const 'tvb_real_ops' is invalid in C++ [-Werror=c++-compat]
../../epan/tvbuff.c:55:29: error: uninitialized const 'tvb_subset_ops' is invalid in C++ [-Werror=c++-compat]
../../epan/tvbuff.c:56:29: error: uninitialized const 'tvb_composite_ops' is invalid in C++ [-Werror=c++-compat]
../../epan/tvbuff.c:3666:29: error: duplicate declaration of 'tvb_real_ops' is invalid in C++ [-Werror=c++-compat]
../../epan/tvbuff.c:54:29: note: previous declaration of 'tvb_real_ops' was here
../../epan/tvbuff.c:3676:29: error: duplicate declaration of 'tvb_subset_ops' is invalid in C++ [-Werror=c++-compat]
../../epan/tvbuff.c:55:29: note: previous declaration of 'tvb_subset_ops' was here
../../epan/tvbuff.c:3686:29: error: duplicate declaration of 'tvb_composite_ops' is invalid in C++ 
[-Werror=c++-compat]
../../epan/tvbuff.c:56:29: note: previous declaration of 'tvb_composite_ops' was here

I assume the intent of the lines around line 54-56 is that they be forward declarations of the structures in 
question, but, apparently, you can't do that in C++

Argh, C++, should be fixed in r50496. If it won't work I think I'll remove static from variables, and make forward 
declaration with extern.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: