comp.lang.ada
 help / color / mirror / Atom feed
* SYSTEM.NAME and SYSTEM.SYSTEM_NAME
@ 1989-12-15 18:43 dritz
  0 siblings, 0 replies; only message in thread
From: dritz @ 1989-12-15 18:43 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1989-12-15 18:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1989-12-15 18:43 SYSTEM.NAME and SYSTEM.SYSTEM_NAME dritz

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