[Bro-Dev] [Bro-Commits] [git/bro] rpc: Add support for enum with explicit enumerator values. (0d37c42)

Vern Paxson vern at icir.org
Fri Dec 10 08:31:33 PST 2010


> >        redef enum foo += {
> >            BAR_E,      # value will be 12
> >            BAR_F = 5,  # value will be  5
> >            BAR_G,      # value will be  6
> >        };
> 
> 
> Quick question, what if this situation is encountered but the enums being autoincremented go up to 11?  Will it skip and make the next one 13?

I'm having a hard time seeing why one would want autoincrement once an
explicit value is used, and it strikes me as buggy.  My view is that either
*all* enums are defined with = X (and it's an error to define two with the
same value of X), or they're all implicit/autoincrement.

		Vern


More information about the bro-dev mailing list