RE: [sv-bc] Question on const declaration RHS

From: Steven Sharp <sharp_at_.....>
Date: Tue Sep 23 2008 - 09:35:45 PDT
>From: "Rich, Dave" <Dave_Rich@mentor.com>

>A "const" does not affect the RHS of the declaration. Whatever is
>allowed for a non-cost variable declaration is allowed for a const. In
>fact, a const variable declared inside an automatic block is initialized
>every time the block is entered to whatever is the current value of the
>RHS expression. It's just that a const variable becomes read-only after
>initialization.

Dave,

The LRM actually does specify different rules for the RHS (initializer)
on a const variable.

This difference is silly, and serves no useful purpose.  If it were
restricted to constant expressions, then it would make the initializer
value well-defined.  But as soon as it allows any variable, including
a const variable, it is susceptible to initialization ordering 
differences.

I pointed this out in a Mantis item a while ago, but nothing has been
done about it.  I assume that various implementors either did not notice
this rule, or realized that it was pointless and ignored it.

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Sep 23 09:36:24 2008

This archive was generated by hypermail 2.1.8 : Tue Sep 23 2008 - 09:37:04 PDT