Wireshark-dev: Re: [Wireshark-dev] (HELP) adding new buffer

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 19 Aug 2009 11:39:25 -0700

On Aug 19, 2009, at 10:48 AM, divya kothapally wrote:

Iam trying to add a new buffer using tvb_new_real_data but at the time to compiling it is giving me a warning saying ISO C90 forbids mixed declarations & code. Does tvb_new_real_data need ISO C99 ??

No, it doesn't need C99.

That's because it doesn't need C99 features such as mixed declarations and code.

Don't do stuff such as:

	char *foo;

		...

	foo = xxx();

		...

	tvbuff_t *bar = tvb_new_real_data(...);

Instead, do:

	char *foo;
	tvbuff_t *bar;

		...

	foo = xxx();

		...

	bar = tvb_new_real_data(...);

I.e., put all your declarations at the *beginning* of a block. That's what C89/C90 require.