ISSUE 33

Number 33
Category errata
Synopsis 17.2: Use of keyword "integer"
State lrmdraft
Class errata-discuss
Arrival-DateSep 06 2001
Originator Daryl Stewart
Release 2001b, 17.2
Environment
Description
Why does the syntax table in section 17.2.1 on p296 show the keyword
"integer" in the syntax of file_open_function while the example in
17.2.2 on p299 does not use the keyword?

It would be simpler to define the syntax as something like
(scuse the html)

file_open_function ::=
$fopen ( file_name_string [ , type ] )

and describe it with

"If a type is included then the system function $fopen returns a
32 bit file descriptor, otherwise it returns a 32 bit multi channel
descriptor."

There are also (apparently bogus) occurrences of the keyword "integer"
in other sections, including 17.2.4.2, 17.2.4.3, 17.2.4.4, 17.2.5,
17.2.7. (there may be more)

If these are attempts to type-annotate the function results, they are
inconsistent with many other pieces of section 17 which make no use of
the keyword...
Fix
The following proposal may not be complete,
in that the LRM should clearly define the type of the
value returned by the system function in each case,
and the LRM does not always do so.

However, the proposal does solve the immediate problem.

In Syntax 17-4 in 17.2.1, in file_open_function, DELETE "integer" twice.

In 17.2.4.2, CHANGE

integer code = $fgets ( str, fd ) ;
TO
integer code ;
code = $fgets ( str, fd ) ;

In 17.2.4.3, CHANGE

integer code = $fscanf ( fd, format, args );
integer code = $sscanf ( str, format, args );
TO
integer code ;
code = $fscanf ( fd, format, args );
code = $sscanf ( str, format, args );

In 17.2.4.4, CHANGE

integer code = $fread ( myreg, fd ) ;
integer code = $fread ( mem, fd ) ;
integer code = $fread ( mem, fd, start ) ;
integer code = $fread ( mem, fd, start, count ) ;
integer code = $fread ( mem, fd, count ) ;
TO
integer code ;
code = $fread ( myreg, fd ) ;
code = $fread ( mem, fd ) ;
code = $fread ( mem, fd, start ) ;
code = $fread ( mem, fd, start, count ) ;
code = $fread ( mem, fd, count ) ;

In 17.2.5, CHANGE

integer pos = $ftell ( fd ) ;
TO
integer pos ;
pos = $ftell ( fd ) ;

In 17.2.7, CHANGE

integer errno = $ferror ( fd, str ) ;
TO
integer errno ;
errno = $ferror ( fd, str ) ;

Audit-Trail
From: Daryl Stewart <Daryl.Stewart@cl.cam.ac.uk>
To: Daryl.Stewart@cl.cam.ac.uk
Cc: btf-bugs@boyd.com, Daryl.Stewart@cl.cam.ac.uk
Subject: Re: errata/33: Use of keyword "integer" (Section 17)
Date: Thu, 06 Sep 2001 15:22:06 +0100

> Precedence: bulk
>
>
> >Number: 33
> >Category: errata
> >Originator: Daryl Stewart
> >Description:
>
>
> Why does the syntax table in section 17.2.1 on p296 show the keyword
> "integer" in the syntax of file_open_function while the example in
> 17.2.2 on p299 does not use the keyword?
>
> It would be simpler to define the syntax as something like
> (scuse the html)
>
> file_open_function ::=
> $fopen ( file_name_string [ , type ] )
>
> and describe it with
>
> "If a type is included then the system function $fopen returns a
> 32 bit file descriptor, otherwise it returns a 32 bit multi channel
> descriptor."
>
> There are also (apparently bogus) occurrences of the keyword "integer"
> in other sections, including 17.2.4.2, 17.2.4.3, 17.2.4.4, 17.2.5,
> 17.2.7. (there may be more)
>
> If these are attempts to type-annotate the function results, they are
> inconsistent with many other pieces of section 17 which make no use of
> the keyword...

Ooops! That html should read

file_open_function ::=
$fopen ( file_name_string [ , type ] )

instead of making [ and ] bold! ;)

cheers
Daryl


From: Shalom Bresticker <Shalom.Bresticker@motorola.com>
To: Daryl.Stewart@cl.cam.ac.uk
Cc: btf-bugs@boyd.com
Subject: Re: errata/33: Use of keyword "integer" (Section 17)
Date: Thu, 06 Sep 2001 17:37:57 +0300

--------------392FAABABC61D891ADA4C72F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Daryl,

In general, Section 17 uses less precise syntax than the rest of the standard.
It was a deliberate decision of the committee, in order to avoid tons of additional work.

By the way, "integer" DOES appear in the example on p. 299, at the very top.

Shalom


Daryl.Stewart@cl.cam.ac.uk wrote:

> Precedence: bulk
>
> >Number: 33
> >Category: errata
> >Originator: Daryl Stewart
> >Description:
>
> Why does the syntax table in section 17.2.1 on p296 show the keyword
> "integer" in the syntax of file_open_function while the example in
> 17.2.2 on p299 does not use the keyword?
>
> It would be simpler to define the syntax as something like
> (scuse the html)
>
> file_open_function ::=
> $fopen ( file_name_string [ , type ] )
>
> and describe it with
>
> "If a type is included then the system function $fopen returns a
> 32 bit file descriptor, otherwise it returns a 32 bit multi channel
> descriptor."
>
> There are also (apparently bogus) occurrences of the keyword "integer"
> in other sections, including 17.2.4.2, 17.2.4.3, 17.2.4.4, 17.2.5,
> 17.2.7. (there may be more)
>
> If these are attempts to type-annotate the function results, they are
> inconsistent with many other pieces of section 17 which make no use of
> the keyword...

--
**************************************************************************
Shalom Bresticker Shalom.Bresticker@motorola.com
Motorola Semiconductor Israel, Ltd. Tel #: +972 9 9522268
P.O.B. 2208, Herzlia 46120, ISRAEL Fax #: +972 9 9522890
**************************************************************************



--------------392FAABABC61D891ADA4C72F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

Daryl,

In general, Section 17 uses less precise syntax than the rest of the
standard.

It was a deliberate decision of the committee, in order to avoid tons
of additional work.

By the way, "integer" DOES appear in the example on p. 299,
at the very top.

Shalom

 

Daryl.Stewart@cl.cam.ac.uk wrote:
<blockquote TYPE=CITE>Precedence: bulk

>Number:         33

>Category:       errata

>Originator:     Daryl Stewart

>Description:

Why does the syntax table in section 17.2.1 on p296 show the keyword

"integer" in the syntax of file_open_function while the example in

17.2.2 on p299 does not use the keyword?

It would be simpler to define the syntax as something like

(scuse the html)

file_open_function ::=

 <b>$fopen (</b> <i>file_name_</i>string <b> [
,</b> type <b> ] )</b>

and describe it with

"If a type is included then the system function $fopen returns a

32 bit file descriptor, otherwise it returns a 32 bit multi channel

descriptor."

There are also (apparently bogus) occurrences of the keyword "integer"

in other sections, including 17.2.4.2, 17.2.4.3, 17.2.4.4, 17.2.5,

17.2.7. (there may be more)

If these are attempts to type-annotate the function results, they are

inconsistent with many other pieces of section 17 which make no use
of

the keyword...

-- 
 **************************************************************************
 Shalom Bresticker                           Shalom.Bresticker@motorola.com
 Motorola Semiconductor Israel, Ltd.                  Tel #: +972 9 9522268
 P.O.B. 2208, Herzlia 46120, ISRAEL                   Fax #: +972 9 9522890
 **************************************************************************

 

--------------392FAABABC61D891ADA4C72F--


From: Daryl Stewart <Daryl.Stewart@cl.cam.ac.uk>
To: Shalom Bresticker <Shalom.Bresticker@motorola.com>
Cc: Daryl.Stewart@cl.cam.ac.uk, btf-bugs@boyd.com
Subject: Re: errata/33: Use of keyword "integer" (Section 17)
Date: Thu, 06 Sep 2001 15:50:00 +0100

Shalom Bresticker <Shalom.Bresticker@motorola.com> wrote:

> In general, Section 17 uses less precise syntax than the rest of the standard.
> It was a deliberate decision of the committee, in order to avoid tons of
> additional work.

Should I read that as "don't mention any more such bugs" or as "how do you
fancy doing the corrections yourself?".
I'd be happy to volunteer if you want someone to :)

I notice the same usage was in section 14 in the October 1995 draft.

> By the way, "integer" DOES appear in the example on p. 299, at the very top.

I meant it doesn't appear as suggested in the syntax - the integer in the
example is part of an integer declaration and not of any system task usage.


cheers
Daryl


From: Stuart Sutherland <stuart@sutherland-hdl.com>
To: Daryl Stewart <Daryl.Stewart@cl.cam.ac.uk>, btf-bugs@boyd.com
Cc:
Subject: Re: errata/33: Use of keyword "integer" (Section 17)
Date: Thu, 06 Sep 2001 10:03:28 -0700

Just my opinion, but I think part of the difficulty here is that there are
two meanings of the word "integer" involved. There is the integer data
type, which is a signed 32-bit variable. Then there is the more generic
usage of the word integer which essentially means a non-floating point
value. The reg data type is also an integer (unsigned by default, and any
vector width). A literal number such as 5 is an integer. It would have
been a good thing if the keyword for the data type in Verilog had been int
instead of integer, but that's not the way it is. The reader will just
have to look at the context around the word "integer" to see if it is being
used as a reserved word or a generic term. Putting the keyword in a
different font would help, as would consistently using the phrase "integer
data type" when specifically referencing the keyword.

Stu

At 08:00 AM 9/6/2001, Daryl Stewart wrote:
>Precedence: bulk
>
>The following reply was made to PR errata/33; it has been noted by GNATS.
>
>From: Daryl Stewart <Daryl.Stewart@cl.cam.ac.uk>
>To: Shalom Bresticker <Shalom.Bresticker@motorola.com>
>Cc: Daryl.Stewart@cl.cam.ac.uk, btf-bugs@boyd.com
>Subject: Re: errata/33: Use of keyword "integer" (Section 17)
>Date: Thu, 06 Sep 2001 15:50:00 +0100
>
> Shalom Bresticker <Shalom.Bresticker@motorola.com> wrote:
>
> > In general, Section 17 uses less precise syntax than the rest of the
> standard.
> > It was a deliberate decision of the committee, in order to avoid tons of
> > additional work.
>
> Should I read that as "don't mention any more such bugs" or as "how do you
> fancy doing the corrections yourself?".
> I'd be happy to volunteer if you want someone to :)
>
> I notice the same usage was in section 14 in the October 1995 draft.
>
> > By the way, "integer" DOES appear in the example on p. 299, at the
> very top.
>
> I meant it doesn't appear as suggested in the syntax - the integer in the
> example is part of an integer declaration and not of any system task usage.
>
>
> cheers
> Daryl
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stuart Sutherland Sutherland HDL Inc.
stuart@sutherland-hdl.com 22805 SW 92nd Place
phone: 503-692-0898 Tualatin, OR 97062
www.sutherland-hdl.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Fix replaced by Shalom.Bresticker@freescale.com on Mon Oct 25 00:58:24 2004

The following proposal may not be complete,
in that the LRM should clearly define the type of the
value returned by the system function in each case,
and the LRM does not always do so.

However, the proposal does solve the immediate problem.

In Syntax 17-4 in 17.2.1, in file_open_function, DELETE "integer" twice.

In 17.2.4.2, CHANGE

integer code = $fgets ( str, fd ) ;
TO
integer code ;
code = $fgets ( str, fd ) ;

In 17.2.4.3, CHANGE

integer code = $fscanf ( fd, format, args );
integer code = $sscanf ( str, format, args );
TO
integer code ;
code = $fscanf ( fd, format, args );
code = $sscanf ( str, format, args );

In 17.2.4.4, CHANGE

integer code = $fread ( myreg, fd ) ;
integer code = $fread ( mem, fd ) ;
integer code = $fread ( mem, fd, start ) ;
integer code = $fread ( mem, fd, start, count ) ;
integer code = $fread ( mem, fd, count ) ;
TO
integer code ;
code = $fread ( myreg, fd ) ;
code = $fread ( mem, fd ) ;
code = $fread ( mem, fd, start ) ;
code = $fread ( mem, fd, start, count ) ;
code = $fread ( mem, fd, count ) ;

In 17.2.5, CHANGE

integer pos = $ftell ( fd ) ;
TO
integer pos ;
pos = $ftell ( fd ) ;

In 17.2.7, CHANGE

integer errno = $ferror ( fd, str ) ;
TO
integer errno ;
errno = $ferror ( fd, str ) ;



Unformatted


Hosted by Boyd Technology