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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!ucbvax!ANTARES.MCS.ANL.GOV!dritz From: dritz@ANTARES.MCS.ANL.GOV Newsgroups: comp.lang.ada Subject: SYSTEM.NAME and SYSTEM.SYSTEM_NAME Message-ID: <8912151843.AA25539@papasun.mcs.anl.gov> Date: 15 Dec 89 18:43:59 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: Recent discussions have analyzed the possibility of simulating some aspects of conditional compilation by basing a case selection on the value of the implementation-defined constant SYSTEM.SYSTEM_NAME. These discussions have mistakenly assumed that the implementation-defined enumeration type SYSTEM.NAME is supposed to (or ought to) contain enumeration literals naming all the implementations of Ada. When these discussions started, there was a suggestion that this type was a good candidate for standardization; more recently, there was an expression of surprise that, in products of "at least two major compiler vendors, with product lines spanning dozens of products," SYSTEM.NAME enumerates "exactly one platform: the machine on which the compiler at hand happens to run." A careful reading of RM 13.7(3-6) will reveal that such Ada implementations are very likely defining SYSTEM.NAME correctly, and in agreement with its intended use. In implementations that have cross-compilation (i.e., multiple target) capabilities within a single compiler, different versions of the predefined package SYSTEM--each corresponding to a different target ("alternative machine configuration," to use the terminology of RM 13.7(3))--can be obtained by compiling a SYSTEM_NAME pragma naming the desired version. The enumeration literal used in the pragma must have as its identifier one of those in the definition of SYSTEM.NAME. The value of SYSTEM.SYSTEM_NAME merely identifies the implementation's "alternative machine configuration" to which the current version of SYSTEM (with its system-dependent named numbers) corresponds. If the compiler does not have cross-compilation capabilities, it is appropriate for the definition of SYSTEM.NAME to include only a single enumeration literal. It is not surprising that attempts to use SYSTEM.NAME and SYSTEM.SYSTEM_NAME for purposes for which they were not intended uncover a variety of difficulties. --Ken Dritz --Argonne National Laboratory --dritz@mcs.anl.gov