Version 1.1 of ais/ai-00256.txt

Unformatted version of ais/ai-00256.txt version 1.1
Other versions for file ais/ai-00256.txt

!standard 13.11.01 (01)          01-02-12 AI95-00256/01
!standard A.12.01 (30)
!class binding interpretation 01-02-12
!status work item 01-02-12
!status received 01-02-12
!qualifier Omission
!priority Low
!difficulty Low
!subject Various wording changes to the standard
!summary
(Note: This AI contains various wording changes that ought to be made to the standard for which there is no opposition to the change. The intent is that this AI will only be processed when a Corrigendum or Revision is about to be issued.)
1) The value of the Size_In_Storage_Elements is the maximum value that could be requested by the implementation.
2) Ada.Streams.Read (and Write) without an index parameter read (or write) at the current index if the file supports positioning.
!question
1) What is the value for Size_In_Storage_Elements?
13.11.1(3) states that:
"S'Max_Size_In_Storage_Elements denotes the maximum value for Size_In_Storage_Elements that will be requested via Allocate for an access type whose designated subtype is S."
This seems to imply that the upper bound depend on the execution of the program. That's because this wording doesn't specify a conservative upper bound, nor a guess or an approximation. Shouldn't this say "that could be requested?" (Yes.)
2) Where do Ada.Streams.Stream_IO.Read (and Write) without an index parameter read (or write) if the file supports positioning? (At the current index.)
Nowhere in A.12.1 is this specified. Defect Report 8652/0055 says that the intent is that stream files with positioning act like Dirct_IO files. Is it OK for an implementation to ignore the current index of a stream file? (No.)
!recommendation
(See summary.)
!wording
(See corrigendum.)
!discussion
1) The intent of the Size_In_Storage_Elements is that it supplies an upper bound on the memory that will be requested from Allocate. Certainly, there was no intent that the value depend on the execution of the program. Thus, we adjust the wording to say clearly what was meant.
2) Defect Report 8652/0055 make it clear that the model of stream files with positioning is to be the same as Direct_IO files. Unfortunately, the wording with that Defect Report failed to say where Read and Write without an index parameter read or write. Compare A.12.1(30) to A.8.5(3) to see the missing text.
!corrigendum 13.11.01(03)
Replace the paragraph:
Denotes the maximum value for Size_In_Storage_Elements that will be requested via Allocate for an access type whose designated subtype is S. The value of this attribute is of type universal_integer.
by:
Denotes the maximum value for Size_In_Storage_Elements that could be requested by the implementation via Allocate for an access type whose designated subtype is S. The value of this attribute is of type universal_integer.
!corrigendum A.12.01(30)
Replace the paragraph:
The procedures Read and Write are equivalent to the corresponding operations in the package Streams. Read propagates Mode_Error if the mode of File is not In_File. Write propagates Mode_Error if the mode of File is not Out_File or Append_File. The Read procedure with a Positive_Count parameter starts reading at the specified index. The Write procedure with a Positive_Count parameter starts writing at the specified index.
by:
The procedures Read and Write are equivalent to the corresponding operations in the package Streams. Read propagates Mode_Error if the mode of File is not In_File. Write propagates Mode_Error if the mode of File is not Out_File or Append_File. The Read procedure with a Positive_Count parameter starts reading at the specified index. The Write procedure with a Positive_Count parameter starts writing at the specified index. For a file that supports positioning, Read without a Positive_Count parameter starts reading at the current index, and Write without a Positive_Count parameter starts writing at the current index.
!ACATS test
1) The existing test CDB0A02 tests Size_In_Stream_Elements.
2) A test should be created that insures that Read and Write operate properly. (This probably will be done as part of the objective for 8652/0055.)
!appendix

From: Randy Brukardt
Sent: Monday, January 15, 2001 5:41 PM

There is a hole in the RM in that it never says that Read and Write
without index parameters actually Read or Write at the current index.
(Compare A.12.1(30) to A.8.5(3).) Certainly, the intent of AI-26 was that
the model of positionable stream files is similar to Direct_IO files. It
certainly would be odd if that didn't include the location of Reading and
Writing. Probably a sentence like the following needs to be added to the RM:

    "For a file that supports positioning, Read without a Positive_Count
parameter starts reading at the current index, and Write without a
Positive_Count parameter starts writing at the current index."

I would assume the above is non-controversial, but since quite a few
compilers ignore it, perhaps I'm wrong.

****************************************************************

Questions? Ask the ACAA Technical Agent