Version 1.1 of ai05s/ai05-0223-1.txt

Unformatted version of ai05s/ai05-0223-1.txt version 1.1
Other versions for file ai05s/ai05-0223-1.txt

!standard A.4.7(28)          10-10-20 AI05-0223-1/01
!standard A.4.8(28/2)
!class binding interpretation 10-10-20
!status work item 10-10-20
!status received 10-03-25
!priority Low
!difficulty Easy
!qualifier Error
!subject Wide_Maps needs finalization
!summary
Types Wide_Character_Set, Wide_Character_Mapping, and the corresponding Wide_Wide_ versions need finalization.
!question
Should the Wide_Character_Set and Wide_Character_Mapping types in Wide_Maps (and the corresponding types in Wide_Wide_Maps) be defined to "need finalization"? (Yes.) It's likely that dynamic allocation will be used to implement those types, and thus it's likely that they would be implemented using controlled types (or equivalent) to avoid memory leakage.
!wording
Add after A.4.7(28):
Types Wide_Character_Set and Wide_Character_Mapping need finalization.
Add after A.4.8(28/2):
Types Wide_Wide_Character_Set and Wide_Wide_Character_Mapping need finalization.
!discussion
The intent of "needs finalization" is to prevent dependence on the actual implementation of the types. At least one major Ada implementation uses controlled types for these types, so they should "need finalization".
!ACATS Test
!appendix

!topic Should Wide_Maps types need finalization?
!reference RM A.4.7, A.4.8, 7.6(9.6/2), AI95-360
!from Adam Beneschan 10-03-25
!discussion


In AI95-360, Randy said:

"As the comment says, that would make the application of the pragma (and
thus the legality of the program) dependent on the precise implementation of
the type. We don't want that, so we've introduced the concept of "needs
finalization" and applied it to various language-defined types. (Perhaps
there should also be a pragma to declare that for user-defined types, but
that's another issue.) A type that "needs finalization" is one that *might*
reasonably be implemented with a controlled part (thus type Integer doesn't
need finalization). In general, we don't want the legality of programs to
depend on what's in private parts, and that applies to restrictions as much
as anything else."

Given that, should the Wide_Character_Set and Wide_Character_Mapping
types in Wide_Maps (and the corresponding types in Wide_Wide_Maps) be
defined to "need finalization"?  I think it's likely that dynamic
allocation will be used to implement those types, and thus it's likely
that they would be implemented using controlled types (or equivalent)
to avoid memory leakage.

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

Questions? Ask the ACAA Technical Agent