1. About This Guide¶
For ease of exposition, ‘GNAT Pro’ will be referred to simply as ‘GNAT’ in the remainder of this document.
This manual contains useful information in writing programs using the GNAT compiler. It includes information on implementation dependent characteristics of GNAT, including all the information required by Annex M of the Ada language standard.
GNAT implements Ada 95, Ada 2005 and Ada 2012, and it may also be invoked in Ada 83 compatibility mode. By default, GNAT assumes Ada 2012, but you can override with a compiler switch to explicitly specify the language version. (Please refer to the GNAT User’s Guide for details on these switches.) Throughout this manual, references to ‘Ada’ without a year suffix apply to all the Ada versions of the language.
Ada is designed to be highly portable. In general, a program will have the same effect even when compiled by different compilers on different platforms. However, since Ada is designed to be used in a wide variety of applications, it also contains a number of system dependent features to be used in interfacing to the external world.
Note: Any program that makes use of implementation-dependent features may be non-portable. You should follow good programming practice and isolate and clearly document any sections of your program that make use of these features in a non-portable manner.
1.1. What This Reference Manual Contains¶
This reference manual contains the following chapters:
Implementation Defined Pragmas, lists GNAT implementation-dependent pragmas, which can be used to extend and enhance the functionality of the compiler.
Implementation Defined Attributes, lists GNAT implementation-dependent attributes, which can be used to extend and enhance the functionality of the compiler.
Standard and Implementation Defined Restrictions, lists GNAT implementation-dependent restrictions, which can be used to extend and enhance the functionality of the compiler.
Implementation Advice, provides information on generally desirable behavior which are not requirements that all compilers must follow since it cannot be provided on all systems, or which may be undesirable on some systems.
Implementation Defined Characteristics, provides a guide to minimizing implementation dependent features.
Intrinsic Subprograms, describes the intrinsic subprograms implemented by GNAT, and how they can be imported into user application programs.
Representation Clauses and Pragmas, describes in detail the way that GNAT represents data, and in particular the exact set of representation clauses and pragmas that is accepted.
Standard Library Routines, provides a listing of packages and a brief description of the functionality that is provided by Ada’s extensive set of standard library routines as implemented by GNAT.
The Implementation of Standard I/O, details how the GNAT implementation of the input-output facilities.
The GNAT Library, is a catalog of packages that complement the Ada predefined library.
Interfacing to Other Languages, describes how programs written in Ada using GNAT can be interfaced to other programming languages.
Specialized Needs Annexes, describes the GNAT implementation of all of the specialized needs annexes.
Implementation of Specific Ada Features, discusses issues related to GNAT’s implementation of machine code insertions, tasking, and several other features.
Implementation of Ada 2012 Features, describes the status of the GNAT implementation of the Ada 2012 language standard.
Security Hardening Features documents GNAT extensions aimed at security hardening.
Obsolescent Features documents implementation dependent features, including pragmas and attributes, which are considered obsolescent, since there are other preferred ways of achieving the same results. These obsolescent forms are retained for backwards compatibility.
Compatibility and Porting Guide presents some guidelines for developing portable Ada code, describes the compatibility issues that may arise between GNAT and other Ada compilation systems (including those for Ada 83), and shows how GNAT can expedite porting applications developed in other Ada environments.
GNU Free Documentation License contains the license for this document.
This reference manual assumes a basic familiarity with the Ada 95 language, as described in the International Standard ANSI/ISO/IEC-8652:1995. It does not require knowledge of the new features introduced by Ada 2005 or Ada 2012. All three reference manuals are included in the GNAT documentation package.
Following are examples of the typographical and graphic conventions used in this guide:
utility program names,
standard names, and
[optional information or parameters]
Examples are described by text
and then shown this way.
Commands that are entered by the user are shown as preceded by a prompt string comprising the
$character followed by a space.