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] [Wireshark-commits] rev 50489: /trunk/epan/ /trunk/epan/: tv

From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
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@xxxxxxxxxxxxx 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.