RE: [sv-bc] Enum proposal uploaded

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Sun May 10 2009 - 05:27:20 PDT
I agree, but I think it should be made more explicit.

Shalom 

> -----Original Message-----
> From: Steven Sharp [mailto:sharp@cadence.com] 
> Sent: Friday, May 08, 2009 10:09 PM
> To: sharp@cadence.com; sv-bc@eda.org; Bresticker, Shalom
> Subject: RE: [sv-bc] Enum proposal uploaded
> 
> 
> >From: "Bresticker, Shalom" <shalom.bresticker@intel.com>
> 
> >How do the auto-increment and duplicate value checking work? 
> I assume on the 
> post-cast values.
> 
> 
> Yes.
> 
> For the auto-increment, the LRM says
> 
> "A name without a value is automatically assigned an increment of the
> value of the previous name.  It shall be an error to automatically
> increment the maximum representable value of the enum."
> 
> The value of the name is the value after the cast.
> 
> The text of the duplicate value check says
> 
> "Both the enumeration names and their integer values shall be unique.
> It shall be an error to set two values to the same name or to set the
> same value to two names, regardless of whether the values are set
> explicitly or by automatic incrementing."
> 
> This may be a little less obvious, but is still talking about 
> the value
> that the name is set to, which is the value after the cast.  (Part of
> why I find this wording less obvious is that it talks about setting a
> value to a name, where the assignment syntax and my mental image are
> of setting the name to a value.  If it said "setting two names to the
> same value", or even "giving the same value two names", that 
> would seem
> more natural to me.)
> 
> The only place that operates with the pre-cast value is the 
> evaluation of
> the expression and the check for truncation during the cast.  
> Everything
> else operates with the value corresponding to the name (set 
> to the name,
> or that the name is set to), which is the value after the cast.
> 
> Steven Sharp
> sharp@cadence.com
> 
> 
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sun May 10 05:29:34 2009

This archive was generated by hypermail 2.1.8 : Sun May 10 2009 - 05:30:31 PDT