![]() |
![]() HP OpenVMS Systems |
![]() |
DEC Ada
|
Previous | Contents | Index |
In DEC Ada, a task stack is allocated each time a nonpassive task is activated. As soon as the task is terminated, the storage for the task stack is deallocated.
If you specify a size of zero (bytes) with T'STORAGE_SIZE, a default stack size is used. Also, regardless of the size specified, some additional space is allocated for task management purposes. On OpenVMS VAX systems, at least 21 pages are allocated. On OpenVMS Alpha systems, at least one page is allocated.
GNAT handles task stacks in a similar manner. According to the Ada 95
rules, it provides the pragma STORAGE_SIZE as an alternative method for
controlling the task stack size. The specification of the attribute
T'STORAGE_SIZE is also supported in a manner compatible with DEC Ada.
E.4.6 External Interrupts
On DEC Ada, external interrupts can be associated with task entries.
GNAT is compatible.
E.5 Pragmas and Pragma-Related Features
Both DEC Ada and GNAT supply all language-defined pragmas as specified by the Ada 83 standard. These pragmas are as follows:
GNAT supplies all the DIGITAL implementation-defined pragmas in the following lists, although these three are ignored:
See the GNAT Reference Manual for details on pragmas.
GNAT supplies all the additional Ada 95 pragmas as follows:
GNAT processes these pragmas in a manner consistent with the definitions in the Ada 95 Reference Manual.
DEC Ada also supplies the following implementation-defined pragmas:
In addition, GNAT supplies the following implementation-defined pragmas:
The Ada language specifies that unrecognized pragmas are accepted but
ignored. Therefore, programs using a GNAT-only pragma on a DIGITAL
implementation compile but do not necessarily run as expected.
E.5.1 Pragma-Related Restrictions
Restrictions on the Pragma INLINE
DEC Ada applies the following restrictions to the pragma INLINE:
In GNAT, the only restriction on pragma INLINE is that the body must occur before the call if both are in the same unit and the size must be appropriately small. There are no other specific restrictions which cause subprograms to be incapable of being inlined.
Restrictions on the Pragma INTERFACE
Following are the restrictions on the pragma INTERFACE on DEC Ada and GNAT:
GNAT is compatible with DEC Ada. In addition, GNAT allows record parameters for all languages.
Restrictions on the Pragma SYSTEM_NAME
The values for the enumeration type NAME vary by system and are not interchangeable.
Restrictions on the Pragma EXPORT_VALUED_PROCEDURE
In DEC Ada and GNAT when a main function or a main procedure declared with the pragma EXPORT_VALUED_PROCEDURE returns a discrete value whose size is less than 64 bits (32 on OpenVMS VAX systems), the value is zero- or sign-extended as appropriate.
Restrictions on the Pragma IMPORT_EXCEPTION
On OpenVMS systems, pragma IMPORT_EXCEPTION allows a specific condition value to be associated with an Ada exception. This pragma is used for implementing exceptions in the OpenVMS operating system.
This restriction is identical in GNAT.
E.6 Library of Predefined Units
A library of predefined units is provided as part of the DEC Ada and GNAT implementations. DEC Ada does not provide the package MACHINE_CODE but instead recommends importing assembler code.
GNAT does not provide the following DEC Ada packages:
Both DEC Ada and GNAT provide packages beyond the minimum required by the Ada language standard.
The GNAT versions of the DEC Ada Run-Time Library (ADA$PREDEFINED:) units are taken from the OpenVMS Alpha version, not the OpenVMS VAX version. During GNAT installation, the DEC Ada Predefined Library units are copied into the DECLIB directory GNU:[LIB.OPENVMS7_x.2_8_x.DECLIB] and patched to remove Ada 95 incompatibilities and to make them interoperable with GNAT. These changes are minor and transparent to users. They include:
The GNAT RTL is contained in the ADALIB directory GNU:[LIB.OPENVMS7_x.2_8_x.ADALIB].
The default search path is set up to find DEC Ada DECLIB units in preference to GNAT ADALIB units with the same name (TEXT_IO, SEQUENTIAL_IO, and DIRECT_IO, for example). However, it is possible to change the default so that the reverse is true, or even to mix them using child package notation. The DEC Ada 83 units are available as DEC.xxx where xxx is the package name, and the Ada units are available as Ada.xxx (the standard manner defined for Ada 95). To change the default, set ADA_INCLUDE_PATH and ADA_OBJECTS_PATH appropriately. For example, to change the default to use the Ada 95 versions specify the following:
$ DEFINE ADA_INCLUDE_PATH "GNU:[LIB.OPENVMS7_1.2_8_0.ADAINCLUDE],- GNU:[LIB.OPENVMS7_1.2_8_0.DECLIB]" $ DEFINE ADA_OBJECTS_PATH "GNU:[LIB.OPENVMS7_1.2_8_0.ADALIB],- GNU:[LIB.OPENVMS7_1.2_8_0.DECLIB]" |
GNAT and DEC Ada on OpenVMS Alpha have compatible bindings. They provide the following strongly typed bindings:
GNAT provides implementations of the OpenVMS DEC bindings in the DECLIB directory.
The X/Motif bindings used to build DECLIB are the versions in the DEC Ada ADA$PREDEFINED directory with extension .ADC. The build script automatically adds a pragma Linker_Options to packages Xm, Xt, and X_Lib causing the default X/Motif shareable image libraries to be linked. This is done via options files named XM.OPT, XT.OPT, and X_LIB.OPT (also located in the DECLIB directory).
It may be necessary to edit these options files to update or correct
the library names if, for example, the newer X/Motif bindings from
ADA$EXAMPLES were (previous to installing GNAT) copied and renamed to
supersede the default ADA$PREDEFINED versions.
E.7.1 Shared Libraries and OPT files
When you use the DEC Ada predefined X and Motif bindings, the linking with their shareable images is done automatically by GNAT LINK. When using other X and Motif bindings, you must add the corresponding shareable images to the command line for GNAT LINK. When linking with shared libraries, or with .OPT files, you must also add them to the command line for GNAT LINK.
A shared library to be used with GNAT is built in the same way as other
libraries under OpenVMS. The OpenVMS LINK command can be used in the
standard way.
E.7.2 Interfaces to C
DEC Ada recognizes the importance of interfacing to C and provides Ada types and operations, as shown in Table E-4.
Type or Operation | Name of Type or Operation |
---|---|
C types package | C_TYPES |
C strings | C_TYPES.NULL_TERMINATED |
Other types | SHORT_INT |
Interfacing to C with GNAT, one can use the approach described in this
section for DEC Ada or the facilities of Annex B of the Ada 95
Reference Manual (packages INTERFACES.C, INTERFACES.C.STRINGS, and
INTERFACES.C.POINTERS). For more information, see the section
"Interfacing to C" in the GNAT Reference Manual.
E.7.3 Main Program Definition
The following section discusses differences in the definition of main programs on DEC Ada and GNAT.
On DEC Ada, main programs are defined to meet the following conditions:
On GNAT, a main program must be a nongeneric, parameter-less subprogram
that is either a procedure or function returning an Ada
STANDARD.INTEGER (the predefined type). It cannot be a generic
subprogram or an instantiation of a generic subprogram.
E.8 Implementation-Defined Attributes
GNAT provides all DEC Ada implementation-defined attributes.
E.9 Compiler and Run-Time Interfacing
DEC Ada provides many qualifiers for passing options to the linker (ACS LINK).
GNAT provides the following qualifiers for passing options to the linker (GNAT LINK):
In DEC Ada, optimization is turned on by default. In GNAT, it is turned off by default.
In both GNAT and DEC Ada, the command-line qualifier /OPTIMIZE is available to control optimization. The qualifier options, which specify the level of optimization, are different.
In DEC Ada, the /OPTIMIZE options are as follows:
See the online help or Developing Ada on OpenVMS Systems for more information on /OPTIMIZE and its options.
In GNAT, the /OPTIMIZE qualifier has the following options:
See the GNAT User's Guide for more information on the /OPTIMIZE options.
DEC Ada also supplies the following pragmas:
Table E-5 summarizes the DEC Ada commands for building programs and the equivalent GNAT commands. DEC Ada instructions do not necessarily translate easily into GNAT instructions. This table is a summary only, with some translations simplified and generalized.
DEC Ada, unlike GNAT, provides a program library and a compilation system (ACS). GNAT provides directories of sources that are compiled as needed. GNAT's collections of source and object files are used in a manner consistent with other languages like C and Fortran. In Table E-5, each GNAT equivalent indicates the closest approximation to the DEC Ada command and does not take into account the effects of qualifiers. The GNAT equivalents marked with a footnote reflect the fact that GNAT does not use the concept of program library.
DEC Ada Command | GNAT Equivalent | Description |
---|---|---|
ADA |
GNAT CHOP
GNAT COMPILE |
Invokes the compiler to compile one or more Ada source files. |
ACS ATTACH | No equivalent | Switches control of terminal from current process running the program library manager. |
ACS CHECK |
GNAT MAKE
/DEPENDENCY_LIST |
Checks completeness and currency. |
ACS COMPILE | GNAT MAKE /NOLINK | Forms the execution closure of one or more specified units, checks completeness and currency, identifies units that have revised source files, compiles same, and recompiles units that are or will become obsolete. Also completes incomplete generic instantiations. |
ACS COPY FOREIGN | COPY 1 | Copies a foreign object file into the program library as a library unit body. |
ACS COPY UNIT | COPY 1 | Copies a compiled unit from one program library to another. |
ACS CREATE LIBRARY | CREATE /DIRECTORY 1 | Creates a program library. |
ACS CREATE SUBLIBRARY | No equivalent | Creates a program sublibrary. |
ACS DELETE LIBRARY | DELETE 1 | Deletes a program library and its contents. |
ACS DELETE SUBLIBRARY | No equivalent | Deletes a program sublibrary and its contents. |
ACS DELETE UNIT | DELETE <file> 1 | On OpenVMS systems, deletes one or more compiled units from the current program library. |
ACS DIRECTORY | DIRECTORY 1 | On OpenVMS systems, lists units contained in the current program library. |
ACS ENTER FOREIGN | COPY 1 | Allows the import of a foreign body as an Ada library specification and enters a reference to a pointer. |
ACS ENTER UNIT | COPY 1 | Enters a reference (pointer) from the current program library to a unit compiled into another program library. |
ACS EXIT | No equivalent | Exits from the program library manager. |
ACS EXPORT | COPY 1 | Creates an object file that contains system-specific object code for one or more units. In GNAT, object files simply can be copied into the desired directory. |
ACS EXTRACT SOURCE | COPY 1 | Allows access to the copied source file for each Ada compilation unit. |
ACS HELP | HELP GNAT | Provides online help. |
ACS LINK | GNAT LINK | Links an object file containing Ada units into an executable file. |
ACS LOAD | GNAT CHOP | Loads (partially compiles) Ada units into the program library. Allows loading a program from a collection of files into a library without knowing the relationship among units. |
ACS MERGE | RENAME 1 | Merges into the current program library, one or more units from another library where they were modified. |
ACS RECOMPILE | GNAT MAKE /NOLINK | Recompiles from external or copied source files any obsolete unit in the closure. Also, completes any incomplete generic instantiations. |
ACS REENTER | GNAT MAKE | Reenters current references to units compiled after last entered with the ACS ENTER UNIT command. |
ACS SET LIBRARY | SET DEFAULT 1 | Defines a program library to be the compilation context as well as the target library for compiler output and commands in general. |
ACS SET PRAGMA | Edit GNAT.adc 1 |
Redefines specified values of the library characteristics
LONG_FLOAT, MEMORY_SIZE, SYSTEM_NAME, and FLOAT_REPRESENTATION. |
ACS SET SOURCE | DEFINE ADA_INCLUDE_PATH <path> 1 | Defines the source file search list for the ACS COMPILE command. |
ACS SHOW LIBRARY | DIRECTORY 1 | Lists information about one or more program libraries. |
ACS SHOW PROGRAM | No equivalent | Lists information about the execution closure of one or more units in the program library. |
ACS SHOW SOURCE | Show logical ADA_INCLUDE_PATH | Shows the source file search used when compiling units. |
ACS SHOW VERSION | Compile with /VERBOSE | Displays the version number of the compiler and program library manager used. |
ACS SPAWN | No equivalent | Creates a subprocess of the current process (same as DCL SPAWN command). |
ACS VERIFY | No equivalent | Performs a series of consistency checks on a program library to determine whether the library structure and library files are in valid form. |
A complete set of the following commands provides an interface to GNAT using familiar OpenVMS-style qualifiers with standard OpenVMS conventions regarding abbreviations and so on. See the GNAT User's Guide for full details or consult the online help system:
On OpenVMS systems, DEC Ada uses OpenVMS Record Management Services (RMS) to perform operations on external files.
DEC Ada and GNAT predefine an identical set of input-output packages ( Section E.6). To make the use of the generic TEXT_IO operations more convenient, DEC Ada provides predefined library packages that instantiate the integer and floating-point operations for the predefined integer and floating-point types as shown in Table E-6.
Package Name | Instantiation |
---|---|
INTEGER_TEXT_IO | INTEGER_IO(INTEGER) |
SHORT_INTEGER_TEXT_IO | INTEGER_IO(SHORT_INTEGER) |
SHORT_SHORT_INTEGER_TEXT_IO | INTEGER_IO(SHORT_SHORT_INTEGER) |
FLOAT_TEXT_IO | FLOAT_IO(FLOAT) |
LONG_FLOAT_TEXT_IO | FLOAT_IO(LONG_FLOAT) |
The DEC Ada predefined packages and their operations are implemented with OpenVMS files and input-output facilities. DEC Ada supports asynchronous input-output on OpenVMS systems. Familiarity with the following is recommended:
Note that GNAT does not support shared generics, which are a feature on DEC Ada on OpenVMS VAX systems. All generic instantiations result in the creation of a specialized copy of the code that uses the supplied formal generic parameters.
GNAT provides I/O facilities that are completely compatible with DEC Ada. The distribution includes the standard DEC Ada versions of all I/O packages, operating in a manner compatible with DEC Ada. In particular, the following packages are by default the DEC Ada (Ada 83) versions of these packages rather than the renamings suggested in annex J of the Ada 95 Reference Manual:
The use of the standard Ada 95 forms for packages (for example, ADA.TEXT_IO) obtains the Ada 95 versions of these packages as defined in the Ada 95 Reference Manual.
GNAT provides DIGITAL-compatible predefined instantiations of the TEXT_IO packages as listed in Table E-6 and also provides the standard predefined instantiations required by the Ada 95 Reference Manual.
For further information on how GNAT interfaces to the file system or how I/O is implemented in programs written in mixed languages, see the chapter "Implementation of the Standard I/O" in the GNAT Reference Manual. In addition to other topics, this chapter covers the following:
The following table lists implementation limits for DEC Ada and GNAT systems.
Limit | DEC Ada | GNAT |
---|---|---|
In a subprogram or entry declaration, maximum number of formal parameters that are of an unconstrained record type | 32 | No set limit |
Maximum identifier length (number of characters) | 255 | 255 |
Maximum number of characters in a source line | 255 | 255 |
Maximum collection size (number of bytes) | 2 31--1 | 2 31--1 |
Maximum number of discriminants for a record type | 245 | No set limit |
Maximum number of formal parameters in an entry or subprogram declaration | 246 | No set limit |
Maximum number of dimensions in an array type | 255 | No set limit |
Maximum number of library units and subunits in a compilation closure 1 | 4095 | No set limit |
Maximum number of library units and subunits in an execution closure 2 | 16383 | No set limit |
Maximum number of objects declared with the pragma COMMON_OBJECT or PSECT_OBJECT | 32757 | No set limit |
Maximum number of enumeration literals in an enumeration type definition | 65535 | No set limit |
Maximum number of lines in a source file | 65534 | No set limit |
Maximum number of bits in any object | 2 31 --1 | 2 31 --1 |
Maximum size of the static portion of a stack frame (approximate) | 2 30 | 2 30 |
Previous | Next | Contents | Index |