Wireshark-dev: Re: [Wireshark-dev] Why are ett[] arrays static?
From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Fri, 19 Oct 2018 13:42:22 -0400


On Fri, Oct 19, 2018 at 1:16 PM Guy Harris <guy@xxxxxxxxxxxx> wrote:
On Oct 19, 2018, at 7:51 AM, Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> wrote:

> Is it just me or is there no reason for ett[] arrays:
>
>     /* Setup protocol subtree array */
>     static gint *ett[] = {
>         &ett_PROTOABBREV
>
> to be static?

Given that they represent persistent UI state - i.e., whether, when packet details are displayed, a particular type of subtree should be displayed as opened up or not - that would seem to indicate that they should be static (in the "in static storage" sense, not in the "with internal linkage" sense).

The ett_ variables themselves must be persistent.  The arrays pointing [for registration purposes] to them?  Not so much.