comp.lang.ada
 help / color / mirror / Atom feed
From: GOODENOUGH@USC-ISI.ARPA (John B. Goodenough)
Subject: Re: Ada compiler bug?!
Date: Wed, 25-Jun-86 11:28:27 EDT	[thread overview]
Date: Wed Jun 25 11:28:27 1986
Message-ID: <8606251629.AA14860@ucbvax.Berkeley.EDU> (raw)
In-Reply-To: 3968@gatech.CSNET

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 <ADA-COMMENT>
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
-------

      reply	other threads:[~1986-06-25 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-06-24 16:20 Ada compiler bug?! Dana Eckart
1986-06-25 15:28 ` John B. Goodenough [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox