RE: [sv-bc] enums in packed arrays/structs

From: Steven Sharp <sharp_at_.....>
Date: Thu Sep 21 2006 - 16:40:30 PDT
>From: "Feldman, Yulik" <yulik.feldman@intel.com>

>My personal suggestion is to allow enums as both members of packed
>structs and as base types of packed arrays and to define type
>compatibility rules for such types.

The proponents of stronger typing for enums may be concerned that this
provides yet another way of setting an enum to an invalid value.  You
can write to the vector as a whole and set the enum members/elements
to arbitrary numeric values.  With packed structs, you can also do it
by writing to bit and part selects of the vector.

I don't care that much about strong typing on enums, especially given
the many ways it can already be bypassed.  But it should be pointed
out for those who do care.

The most important thing here is for the LRM to specify clearly
whether enums are allowed as members of packed structs and unions,
and as elements of packed arrays.

I think the next most important thing is that we should be consistent
between them.  Unless there is a good reason for them to be different,
I think enums should either be allowed in both or in neither.

I have a slight preference for allowing enums in both, but I think this 
is much less important than making the LRM clear and consistent.

Steven Sharp
sharp@cadence.com
Received on Thu Sep 21 16:40:37 2006

This archive was generated by hypermail 2.1.8 : Thu Sep 21 2006 - 16:40:52 PDT