Re: [sv-ec] Re: clarificstion about enumeration typed objects


Subject: Re: [sv-ec] Re: clarificstion about enumeration typed objects
From: Kevin Cameron (sv-xx@grfx.com)
Date: Sun Dec 08 2002 - 00:08:31 PST


> From: Dave Rich <David.Rich@synopsys.com>
>
> Francoise,
>
> According to section 3.1, "SystemVerilog supports the C built-in types,
> with the meaning given by the implementation C compiler."
>
> So the default value is red.
>
> Dave

The only default initial value in C is zero for static/global data, if
the C enum was:

   typedef enum {red = 1, blue, green} Colors;

then

   Colors c;

will give c = 0 for global and static declarations - i.e. not a valid enum
value, and it is undefined if it is automatic.

Kev.

 
> Francoise Martinolle wrote:
>
> >What is the defasult value of a object (variable) defined of an enumeration type.
> >
> >Let's assume enum Colors = {red, blue, green};
> >Colors c;
> >What is the value of c?
> >
> >I don't see it specified in the standard.
> >
> >Francoise
> > '
>
> --
> --
> Dave Rich
> Principal Engineer, CAE, VTG
> Tel: 650-584-4026
> Cell: 510-589-2625
> DaveR@Synopsys.com



This archive was generated by hypermail 2b28 : Sun Dec 08 2002 - 00:10:09 PST