From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,INVALID_DATE, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!USC-ISI.ARPA!GOODENOUGH From: GOODENOUGH@USC-ISI.ARPA (John B. Goodenough) Newsgroups: net.lang.ada Subject: Re: Ada compiler bug?! Message-ID: <8606251629.AA14860@ucbvax.Berkeley.EDU> Date: Wed, 25-Jun-86 11:28:27 EDT Article-I.D.: ucbvax.8606251629.AA14860 Posted: Wed Jun 25 11:28:27 1986 Date-Received: Sat, 28-Jun-86 03:08:25 EDT References: <3968@gatech.CSNET> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: First, the ACVC team wants to hear about bugs in validated compilers. Your report is an excellent example. Example code that illustrates a purported problem is important. In addition, it is useful to know which ACVC version was used to validate the compiler you are using. Other people are encouraged to submit similar reports to ACVC at USC-ISIF.ARPA (the ISIF address is soon to change to ADA20.ISI.EDU). Now that the advertising is done with ... The problem you report falls in an interesting gray area -- the RM appears to say the instantiation is illegal, but the tests, as of version 1.8, require that the instantiation be accepted. First let's look at what the RM says. According to paragraph 12.3.2(4), the instantiation is illegal because of the LIST_NODE declaration: type LIST_NODE is record ITEM : ELEMENT_TYPE; NEXT : LIST; end record; The actual subtype in the instantiation is a type with discriminants, and the occurrence of ELEMENT_TYPE is indeed at a place where either a constraint or default discriminants would be required for an array type or for a type with discriminants. (To see this more clearly, suppose the actual parameter were STRING; the declaration of LIST_NODE would then clearly be illegal.) The wording of the RM makes no distinction for actual subtypes whose discriminants have defaults. So according to paragraph 12.3.2(4), the instantiation is indeed illegal. To put it mildly, you are probably dismayed to find your instantiation is indeed illegal. There was a similar reaction in January 1984 (actually even earlier) when Douglas Arndt and others at Textron's Bell Technical Operations discovered this problem. They submitted a very clear analysis of the negative consequences of this RM rule. In February, 1985, the Ada Language Maintenance Committee considered the issue and recommended a binding interpretation making such instantiations legal when the actual subtype is an unconstrained type with discriminants that have defaults. Under this recommended interpretation, your example is legal and must be accepted by validated compilers. The LMC recommendation was approved by WG9 (the group responsible for the soon-to-be-approved International Standard) in May 1985 and also by an informal group that was later to become the Ada Board. Based on these approvals, the validation tests were changed to enforce the approved "interpretation". Tests in the existing validation suite that were not consistent with this interpretation were withdrawn. The tests that enforce the approved interpretation were included in version 1.8 of the validation suite, which became effective June 1, 1986 (i.e., just this month). Implementations validated under versions 1.6 or 1.7 might also conform to this interpretation, but there were no tests requiring them to do so. The Language Maintenance Committee's analysis that addresses this issue is AI-00037, which can be found in file AI-00037-BI.WP in account at USC-ISIF.ARPA. This commentary has been approved provisionally, meaning some wording changes were requested to improve the analysis and phrasing of the recommendation, but the intent of the commentary was approved. (If you are interested in seeing the commentary and don't have FTP access to ISIF, send a message to ADA-COMMENT at USC-ISIF.ARPA requesting that a copy be sent to you by electronic mail. You can also be notified automatically when commentaries on the language are updated, and copies of the commentaries can be sent to you electronically as well. You can request these services by sending a message to ADA-COMMENT.) John B. Goodenough Chair, Ada Language Maintenance Committee/Panel -------