Re: [sv-bc] 4.3 out of range indexes


Subject: Re: [sv-bc] 4.3 out of range indexes
From: Greg Jaxon (Greg.Jaxon@synopsys.com)
Date: Fri Oct 17 2003 - 10:25:09 PDT


In other programming language standards, there are usually two concepts
separately defined

     1) Conforming implementations of the language - i.e. compilers that
        do what the standard says.
     2) Conforming programs written in the language. i.e. codes that use only
        the subset which the standard requires all compilers to agree upon.

I'm guessing that this author intends to exclude out-of-bound indexes from (2)
but not require bounds checking from every (1).

Bounds checking costs are not always welcome. A stronger requirement would
involve saying that conforming compilers must have a mode in which they check
for bounds violations. For synthesis, this is limited to compile-time
checks and warnings (although in the case of 2-state variables, won't all
accesses happen at compile-time?).

Greg Jaxon

Greg Jaxon

Shalom.Bresticker@motorola.com wrote:
> Sorry if this was already brought up.
>
> The last paragraph of 4.3 says,
>
> "Out of range index values shall be illegal for both reading from and
> writing to an array of 2-state variables, such as 'int'. The result of an
> out of range index is indeterminate. Implementations shall generate a
> warning if an out of range index occurs for a read or write operation."
>
> I don't understand what this "illegal" means.
> "Illegal" usually means that it generates a fatal error.
> If the behavior is discussed ("indeterminate" in this case),
> and the simulation continues, then it becomes a "use at your own risk",
> but not illegal?
>
> Thanks,
> Shalom
>



This archive was generated by hypermail 2b28 : Fri Oct 17 2003 - 10:26:41 PDT