!standard 10.1.4(3) 04-04-23 AC95-00095/01 !standard 10.1.4(5) !standard 10.1.4(6) !standard 10.1.4(7) !standard 10.1.4(9) !class confirmation 04-04-23 !status received no action 04-04-23 !status received 04-04-08 !subject Compilation Environment !summary !appendix !topic compilation environment !reference RM95-10.1.4 !from Dan Eilers 04-04-08 !discussion RM 10.1.4(5) states: "When a compilation unit is compiled, all compilation units upon which it depends semantically shall already exist in the environment; ..." This requirement appears to be a vacuous vestige of the Ada83 rule, RM83 10.3(2), which states: "A compilation unit must be compiled after all library units named in its context clause." But Ada95 does not impose any such order-of-compilation requirements. Ada95 allows units in the environment that haven't been successfully compiled (RM 10.1.4(6)), and by implication, a unit does not even need to have been written yet in order to exist in the environment. So this requirement is vacuous. Suggest changing it to an implementation permission following RM 10.1.4(6), such as "An implementation may require that when a compilation unit is compiled, all compilation units on which it depends semantically shall already exist in the environment." - - - - - - - - - RM 10.1.4(6,7) refers in several places to adding/inserting a unit into _the_ environment. This should probably be _an_ environment, since Ada95 doesn't require a single environment, and a unit may be simultaneously added to any number of environments, and a unit may be added to an environment in circumstances unrelated to its own compilation. - - - - - - - - - RM 10.1.4(9) (Note 6) states: "An implementation may support a concept of a library, which contains library_items. If multiple libraries are supported, the implementation has to define how a single environment is constructed ..." The "If" clause in this note is superfluous, and implies that the converse might not be true. But an implementation ought to define how a single environment is constructed whether or not (single or multiple) libraries are supported. - - - - - - - - - RM 10.1.4(3) states: "The mechanisms for creating an environment and for adding and replacing compilation units within an environment are implementation defined." I think that "deleting" units from an environment should also be mentioned. Maybe this sentence could be simplified by combining it with with RM 10.1.4(9) to say something like "An implementation has to define how an environment is constructed when a compilation unit is submitted to the compiler." - - - - - - - - - RM 10.1.4(7) allows an implementation to retain obsolete units in the library, in circumstances other than inlining. Am I correct in assuming that an implementation must automatically recompile any such obsolete units at link time, based on the reasoning of AI-245, which states: "10.2(27) ensures that an inconsistent partition cannot be linked. That means that an implementation that neither removed Q from the environment nor automatically recompiled it would be incorrect." If so, a note to that effect would be helpful. ****************************************************************