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] Why are ett[] arrays static?

From: Peter Wu <peter@xxxxxxxxxxxxx>
Date: Fri, 19 Oct 2018 17:40:36 +0200
On Fri, Oct 19, 2018 at 10:51:48AM -0400, Jeff Morriss 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?
> 
> It seems to me that making it static is just wasting space (keeping the
> array around forever)?

You are right, it has been static since its introduction in 1999, see
commit a7aba0a28890856d2570951c2b0a76c922fdfa72

Almost all occurrences can be replaced by 'gint *const ett[]' ("an array
of const pointer to int") as the array itself remains unmodified.
-- 
Kind regards,
Peter Wu
https://lekensteyn.nl