GNAT GPL User's Guide: About This Guide

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# About This Guide

This guide describes the use of GNAT GPL, a compiler and software development toolset for the full Ada programming language. It documents the features of the compiler and tools, and explains how to use them to build Ada applications.

GNAT GPL implements Ada 95, Ada 2005 and Ada 2012, and it may also be invoked in Ada 83 compatibility mode. By default, GNAT GPL assumes Ada 2012, but you can override with a compiler switch (see section 3.2.9 Compiling Different Versions of Ada) to explicitly specify the language version. Throughout this manual, references to "Ada" without a year suffix apply to all Ada 95/2005/2012 versions of the language.

For ease of exposition, "GNAT GPL" will be referred to simply as "GNAT" in the remainder of this document.

> What This Guide Contains |  |
> What You Should Know before Reading This Guide |  |
> Related Information |  |
> Conventions |  |

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## What This Guide Contains

This guide contains the following chapters:

- 1. Getting Started with GNAT, describes how to get started compiling and running Ada programs with the GNAT Ada programming environment.
- 2. The GNAT Compilation Model, describes the compilation model used by GNAT.

- 3. Compiling with `gcc`, describes how to compile Ada programs with `gcc`, the Ada compiler.

- 4. Binding with `gnatbind`, describes how to perform binding of Ada programs with `gnatbind`, the GNAT binding utility.

- 5. Linking with `gnatlink`, describes `gnatlink`, a program that provides for linking using the GNAT run-time library to construct a program. `gnatlink` can also incorporate foreign language object units into the executable.

- 6. The GNAT Make Program `gnatmake`, describes `gnatmake`, a utility that automatically determines the set of sources needed by an Ada compilation unit, and executes the necessary compilations binding and link.

- 7. Improving Performance, shows various techniques for making your Ada program run faster or take less space and describes the effect of the compiler's optimization switch. It also describes the `gnatelim` tool and unused subprogram/data elimination.

- 8. Renaming Files with `gnatchop`, describes `gnatchop`, a utility that allows you to preprocess a file that contains Ada source code, and split it into one or more new files, one for each compilation unit.

- 9. Configuration Pragmas, describes the configuration pragmas handled by GNAT.

- 10. Handling Arbitrary File Naming Conventions with `gnatname`, shows how to override the default GNAT file naming conventions, either for an individual unit or globally.

- 11. GNAT Project Manager, describes how to use project files to organize large projects.

- 13. The Cross-Referencing Tools `gnatxref` and `gnatfind`, discusses `gnatxref` and `gnatfind`, two tools that provide an easy way to navigate through sources.

- 14. The GNAT Pretty-Printer `gnatpp`, shows how to produce a reformatted version of an Ada source file with control over casing, indentation, comment placement, and other elements of program presentation style.

- 15. The Ada-to-XML converter `gnat2xml`, shows how to convert Ada source code into XML.

- 16. The GNAT Metrics Tool `gnatmetric`, shows how to compute various metrics for an Ada source file, such as the number of types and subprograms, and assorted complexity measures.

- 17. File Name Krunching with `gnatkr`, describes the `gnatkr` file name krunching utility, used to handle shortened file names on operating systems with a limit on the length of names.

- 18. Preprocessing with `gnatprep`, describes `gnatprep`, a preprocessor utility that allows a single source file to be used to generate multiple or parameterized source files by means of macro substitution.

- 19. The GNAT Library Browser `gnatls`, describes `gnatls`, a utility that displays information about compiled units, including dependences on the corresponding sources files, and consistency of compilations.

- 20. Cleaning Up with `gnatclean`, describes `gnatclean`, a utility to delete files that are produced by the compiler, binder and linker.

- 21. GNAT and Libraries, describes the process of creating and using Libraries with GNAT. It also describes how to recompile the GNAT run-time library.

- 22. Using the GNU `make` Utility, describes some techniques for using the GNAT toolset in Makefiles.

- 23. Memory Management Issues, describes some useful predefined storage pools and in particular the GNAT Debug Pool facility, which helps detect incorrect memory references. It also describes `gnatmem`, a utility that monitors dynamic allocation and deallocation and helps detect "memory leaks".

- 24. Stack Related Facilities, describes some useful tools associated with stack checking and analysis.

- 25. Verifying Properties with `gnatcheck`, discusses `gnatcheck`, a utility that checks Ada code against a set of rules.

- 26. Creating Sample Bodies with `gnatstub`, discusses `gnatstub`, a utility that generates empty but compilable bodies for library units.

- 27. Creating Unit Tests with `gnattest`, discusses `gnattest`, a utility that generates unit testing templates for library units.

- 28. Performing Dimensionality Analysis in GNAT, describes the Ada 2012 facilities used in GNAT to declare dimensioned objects, and to verify that uses of these objects are consistent with their given physical dimensions (so that meters cannot be assigned to kilograms, and so on).

- 29. Generating Ada Bindings for C and C++ headers, describes how to generate automatically Ada bindings from C and C++ headers.

- 30. Other Utility Programs, discusses several other GNAT utilities, including `gnathtml`.

- 31. Code Coverage and Profiling, describes how to perform a structural coverage and profile the execution of Ada programs.

- 32. Running and Debugging Ada Programs, describes how to run and debug Ada programs.

- A. Platform-Specific Information for the Run-Time Libraries, describes the various run-time libraries supported by GNAT on various platforms and explains how to choose a particular library.

- B. Example of Binder Output File, shows the source code for the binder output file for a sample program.

- C. Elaboration Order Handling in GNAT, describes how GNAT helps you deal with elaboration order issues.

- D. Overflow Check Handling in GNAT, describes how GNAT helps you deal with arithmetic overflow issues.

- E. Conditional Compilation, describes how to model conditional compilation, both with Ada in general and with GNAT facilities in particular.

- F. Inline Assembler, shows how to use the inline assembly facility in an Ada program.

- G. Compatibility and Porting Guide, contains sections on compatibility of GNAT with other Ada development environments (including Ada 83 systems), to assist in porting code from those environments.

- H. Microsoft Windows Topics, presents information relevant to the Microsoft Windows platform.

- I. Mac OS Topics, presents information relevant to Apple's OS X platform.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## What You Should Know before Reading This Guide

This guide assumes a basic familiarity with the Ada 95 language, as described in the International Standard ANSI/ISO/IEC-8652:1995, January 1995. It does not require knowledge of the new features introduced by Ada 2005, (officially known as ISO/IEC 8652:1995 with Technical Corrigendum 1 and Amendment 1). Both reference manuals are included in the GNAT documentation package.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## Related Information

For further information about related tools, refer to the following documents:

- See section `About This Guide' in GNAT Reference Manual, which contains all reference material for the GNAT implementation of Ada.

- Using the GNAT Programming Studio, which describes the GPS Integrated Development Environment.

- GNAT Programming Studio Tutorial, which introduces the main GPS features through examples.

- Ada 95 Reference Manual, which contains reference material for the Ada 95 programming language.

- Ada 2005 Reference Manual, which contains reference material for the Ada 2005 programming language.

- See section `Debugging with GDB' in Debugging with GDB, for all details on the use of the GNU source-level debugger.

- See section `The extensible self-documenting text editor' in GNU Emacs Manual, for full information on the extensible editor and programming environment Emacs.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## Conventions

Following are examples of the typographical and graphic conventions used in this guide:

- `Functions`, `utility program names`, `standard names`, and `classes`.

- ``Option flags'`

- ``File names'`, ``button names'`, and ``field names'`.

- `Variables`, `environment variables`, and metasyntactic variables.

- Emphasis.

- [optional information or parameters]

- Examples are described by text

      and then shown this way.

Commands that are entered by the user are preceded in this manual by the characters "`$` " (dollar sign followed by space). If your system uses this sequence as a prompt, then the commands will appear exactly as you see them in the manual. If your system uses some other prompt, then the command will appear with the `$` replaced by whatever prompt character you are using.

Full file names are shown with the "`/`" character as the directory separator; e.g., ``parent-dir/subdir/myfile.adb'`. If you are using GNAT on a Windows platform, please note that the "`\`" character should be used instead.

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by GNAT Mailserver on April, 17 2014 using texi2html