Re: [sv-bc] can a struct field be a constant expression

From: Andy Tsay <andytsay@yahoo.com>
Date: Thu Sep 02 2004 - 14:42:40 PDT

Hi,

The current syntax for "constant_expression" seems to be limited.
The following example is also not supported:
    const int digits[0:9] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
    const int three = digits[3];

Thanks,
Andy Tsay

--- Paul Graham <pgraham@cadence.com> wrote:

> Can a reference to a field of a struct be a constant expression? The
> syntax for constant_expression and constant_primary don't seem to
> include it. I'm thinking of something like:
>
> const struct { int x; } s = {x:1};
> const int y = s.x;
>
> For what it's worth, vhdl does not allow a record field reference to
> be used in a context requiring a locally-static expression.
>
> Paul
>
Received on Thu Sep 2 14:42:44 2004

This archive was generated by hypermail 2.1.8 : Thu Sep 02 2004 - 14:42:56 PDT