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: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 10 Jul 2013 18:04:13 -0700
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

../../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++:

	http://stackoverflow.com/questions/598369/forward-declaring-static-c-struct-instances-in-c