OSDN Git Service

2008-04-08 Ed Schonberg <schonberg@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / gnat_ugn.texi
index ec77d30..69a2a3d 100644 (file)
@@ -6,7 +6,7 @@
 @c                                                                            o
 @c                             G N A T _ U G N                                o
 @c                                                                            o
-@c                     Copyright (C) 1992-2007, AdaCore                       o
+@c                     Copyright (C) 1992-2008, AdaCore                       o
 @c                                                                            o
 @c  GNAT is free software;  you can  redistribute it  and/or modify it under  o
 @c  terms of the  GNU General Public License as published  by the Free Soft-  o
 @set NONDEFAULTLANGUAGEVERSION Ada 95
 
 @ifset unw
-@setfilename gnat_ugn_unw.info
-@end ifset
-
-@ifset unw
 @set PLATFORM
-@set FILE gnat_ugn_unw
 @end ifset
 
 @ifset vms
 @set PLATFORM OpenVMS
-@set FILE gnat_ugn_vms
 @end ifset
 
 @settitle @value{EDITION} User's Guide @value{PLATFORM}
 @dircategory GNU Ada tools
 @direntry
-* @value{EDITION} User's Guide (@value{FILE}) @value{PLATFORM}
+* @value{EDITION} User's Guide (gnat_ugn) @value{PLATFORM}
 @end direntry
 
 @include gcc-common.texi
 @c %**end of header
 
 @copying
-Copyright @copyright{} 1995-2005, Free Software Foundation
+Copyright @copyright{} 1995-2005, 2006, 2007, 2008 Free Software Foundation,
+Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.2
@@ -199,6 +194,9 @@ AdaCore@*
 * Creating Sample Bodies Using gnatstub::
 * Other Utility Programs::
 * Running and Debugging Ada Programs::
+@ifclear vms
+* Code Coverage and Profiling::
+@end ifclear
 @ifset vms
 * Compatibility with HP Ada::
 @end ifset
@@ -507,6 +505,13 @@ Other Utility Programs
 * The External Symbol Naming Scheme of GNAT::
 * Converting Ada Files to html with gnathtml::
 
+@ifclear vms
+Code Coverage and Profiling
+
+* Code Coverage of Ada Programs using gcov::
+* Profiling an Ada Program using gprof::
+@end ifclear
+
 Running and Debugging Ada Programs
 
 * The GNAT Debugger GDB::
@@ -591,6 +596,7 @@ Platform-Specific Information for the Run-Time Libraries
 * Solaris-Specific Considerations::
 * Linux-Specific Considerations::
 * AIX-Specific Considerations::
+* Irix-Specific Considerations::
 
 Example of Binder Output File
 
@@ -846,6 +852,12 @@ a utility that generates empty but compilable bodies for library units.
 @ref{Other Utility Programs}, discusses several other GNAT utilities,
 including @code{gnathtml}.
 
+@ifclear vms
+@item
+@ref{Code Coverage and Profiling}, describes how to perform a structural
+coverage and profile the execution of Ada programs.
+@end ifclear
+
 @item
 @ref{Running and Debugging Ada Programs}, describes how to run and debug
 Ada programs.
@@ -922,8 +934,9 @@ documents:
 
 @itemize @bullet
 @item
-@cite{GNAT Reference Manual}, which contains all reference
-material for the GNAT implementation of Ada.
+@xref{Top, GNAT Reference Manual, About This Guide, gnat_rm, GNAT
+Reference Manual}, which contains all reference material for the GNAT
+implementation of Ada.
 
 @ifset unw
 @item
@@ -944,18 +957,19 @@ material for the Ada 95 programming language.
 material for the Ada 2005 programming language.
 
 @item
-@cite{Debugging with GDB}
+@xref{Top,, Debugging with GDB, gdb, Debugging with GDB},
 @ifset vms
-, located in the GNU:[DOCS] directory,
+in the GNU:[DOCS] directory,
 @end ifset
-contains all details on the use of the GNU source-level debugger.
+for all details on the use of the GNU source-level debugger.
 
 @item
-@cite{GNU Emacs Manual}
+@xref{Top,, The extensible self-documenting text editor, emacs,
+GNU Emacs Manual},
 @ifset vms
-located in the GNU:[DOCS] directory if the EMACS kit is installed,
+located in the GNU:[DOCS] directory if the EMACS kit is installed,
 @end ifset
-contains full information on the extensible editor and programming
+for full information on the extensible editor and programming
 environment Emacs.
 
 @end itemize
@@ -972,17 +986,18 @@ in this guide:
 
 @itemize @bullet
 @item
-@code{Functions}, @code{utility program names}, @code{standard names},
+@code{Functions}, @command{utility program names}, @code{standard names},
 and @code{classes}.
 
 @item
-@samp{Option flags}
+@option{Option flags}
 
 @item
-@file{File Names}, @file{button names}, and @file{field names}.
+@file{File names}, @samp{button names}, and @samp{field names}.
 
 @item
-@var{Variables}.
+@code{Variables}, @env{environment variables}, and @var{metasyntactic
+variables}.
 
 @item
 @emph{Emphasis}.
@@ -1346,7 +1361,7 @@ written as @kbd{C-h}), and the tutorial by @kbd{C-h t}.
 
 Documentation on Emacs and other tools is available in Emacs under the
 pull-down menu button: @code{Help - Info}. After selecting @code{Info},
-use the middle mouse button to select a topic (e.g. Emacs).
+use the middle mouse button to select a topic (e.g.@: Emacs).
 
 In a character cell terminal, do @kbd{C-h i} to invoke info, and then @kbd{m}
 (stands for menu) followed by the menu item desired, as in @kbd{m Emacs}, to
@@ -1622,7 +1637,7 @@ statement @code{Put_Line@ (Line@ (1..N));}
 Select @code{Debug}, then @code{Run}.  When the
 @code{Program Arguments} window appears, click @code{OK}.
 A console window will appear; enter some line of text,
-e.g. @code{abcde}, at the prompt.
+e.g.@: @code{abcde}, at the prompt.
 The program will pause execution when it gets to the
 breakpoint, and the corresponding line is highlighted.
 
@@ -1785,7 +1800,7 @@ of the compiler (@pxref{Character Set Control}).
 @noindent
 The basic character set is Latin-1. This character set is defined by ISO
 standard 8859, part 1. The lower half (character codes @code{16#00#}
-... @code{16#7F#)} is identical to standard ASCII coding, but the upper half
+@dots{} @code{16#7F#)} is identical to standard ASCII coding, but the upper half
 is used to represent additional characters. These include extended letters
 used by European languages, such as French accents, the vowels with umlauts
 used in German, and the extra letter A-ring used in Swedish.
@@ -1854,7 +1869,7 @@ lowercase equivalence.
 Any character in the range 80-FF allowed in identifiers, and all are
 considered distinct. In other words, there are no uppercase and lowercase
 equivalences in this range. This is useful in conjunction with
-certain encoding schemes used for some foreign character sets (e.g.
+certain encoding schemes used for some foreign character sets (e.g.,
 the typical method of representing Chinese characters on the PC).
 
 @item No Upper-Half
@@ -1930,14 +1945,14 @@ is a one, two, or three byte sequence:
 @iftex
 @leftskip=.7cm
 @end iftex
-16#0000#-16#007f#: 2#0xxxxxxx#
-16#0080#-16#07ff#: 2#110xxxxx# 2#10xxxxxx#
-16#0800#-16#ffff#: 2#1110xxxx# 2#10xxxxxx# 2#10xxxxxx#
+16#0000#-16#007f#: 2#0@var{xxxxxxx}#
+16#0080#-16#07ff#: 2#110@var{xxxxx}# 2#10@var{xxxxxx}#
+16#0800#-16#ffff#: 2#1110@var{xxxx}# 2#10@var{xxxxxx}# 2#10@var{xxxxxx}#
 
 @end smallexample
 
 @noindent
-where the xxx bits correspond to the left-padded bits of the
+where the @var{xxx} bits correspond to the left-padded bits of the
 16-bit character value. Note that all lower half ASCII characters
 are represented as ASCII bytes and all upper half characters and
 other wide characters are represented as sequences of upper-half
@@ -1983,10 +1998,10 @@ the unit and replacing the separating dots with hyphens and using
 An exception arises if the file name generated by the above rules starts
 with one of the characters
 @ifset vms
-A,G,I, or S,
+@samp{A}, @samp{G}, @samp{I}, or @samp{S},
 @end ifset
 @ifclear vms
-a,g,i, or s,
+@samp{a}, @samp{g}, @samp{i}, or @samp{s},
 @end ifclear
 and the second character is a
 minus. In this case, the character ^tilde^dollar sign^ is used in place
@@ -1994,10 +2009,10 @@ of the minus. The reason for this special rule is to avoid clashes with
 the standard names for child units of the packages System, Ada,
 Interfaces, and GNAT, which use the prefixes
 @ifset vms
-S- A- I- and G-
+@samp{S-}, @samp{A-}, @samp{I-}, and @samp{G-},
 @end ifset
 @ifclear vms
-s- a- i- and g-
+@samp{s-}, @samp{a-}, @samp{i-}, and @samp{g-},
 @end ifclear
 respectively.
 
@@ -2097,7 +2112,7 @@ GNAT allows completely arbitrary file names to be specified using the
 source file name pragma. However, if the file name specified has an
 extension other than @file{.ads} or @file{.adb} it is necessary to use
 a special syntax when compiling the file. The name in this case must be
-preceded by the special sequence @code{-x} followed by a space and the name
+preceded by the special sequence @option{-x} followed by a space and the name
 of the language, here @code{ada}, as in:
 
 @smallexample
@@ -2109,7 +2124,8 @@ $ gcc -c -x ada peculiar_file_name.sim
 @command{gnatmake} handles non-standard file names in the usual manner (the
 non-standard file name for the main program is simply used as the
 argument to gnatmake). Note that if the extension is also non-standard,
-then it must be included in the gnatmake command, it may not be omitted.
+then it must be included in the @command{gnatmake} command, it may not
+be omitted.
 
 @node Alternative File Naming Schemes
 @section Alternative File Naming Schemes
@@ -2174,7 +2190,7 @@ a separate @code{Subunit_File_Name} rule, and in this case the
 @code{Body_File_name} rule is used for subunits as well.
 
 The separate rule for subunits can also be used to implement the rather
-unusual case of a compilation environment (e.g. a single directory) which
+unusual case of a compilation environment (e.g.@: a single directory) which
 contains a subunit and a child unit with the same unit name. Although
 both units cannot appear in the same partition, the Ada Reference Manual
 allows (but does not require) the possibility of the two units coexisting
@@ -2431,7 +2447,7 @@ A list of relevant restrictions applying to the unit (used for consistency)
 checking.
 
 @item
-Categorization information (e.g. use of pragma @code{Pure}).
+Categorization information (e.g.@: use of pragma @code{Pure}).
 
 @item
 Information on all @code{with}'ed units, including presence of
@@ -2881,7 +2897,7 @@ This is relevant only to Windows XP/2000/NT implementations of GNAT,
 and specifies that the @code{Stdcall} calling sequence will be used,
 as defined by the NT API. Nevertheless, to ease building
 cross-platform bindings this convention will be handled as a @code{C} calling
-convention on non Windows platforms.
+convention on non-Windows platforms.
 
 @findex DLL
 @cindex Convention DLL
@@ -2950,8 +2966,8 @@ Interface ---see http://www.codesourcery.com/archives/cxx-abi).
 
 @noindent
 Interfacing can be done at 3 levels: simple data, subprograms, and
-classes. In the first two cases, GNAT offers a specific @var{Convention
-C_Plus_Plus} (or @var{CPP}) that behaves exactly like @var{Convention C}.
+classes. In the first two cases, GNAT offers a specific @code{Convention
+C_Plus_Plus} (or @code{CPP}) that behaves exactly like @code{Convention C}.
 Usually, C++ mangles the names of subprograms, and currently, GNAT does
 not provide any help to solve the demangling problem. This problem can be
 addressed in two ways:
@@ -2967,8 +2983,8 @@ the pragma import.
 
 @noindent
 Interfacing at the class level can be achieved by using the GNAT specific
-pragmas such as @code{CPP_Constructor}. See the GNAT Reference Manual for
-additional information.
+pragmas such as @code{CPP_Constructor}.  @xref{Interfacing to C++,,,
+gnat_rm, GNAT Reference Manual}, for additional information.
 
 @node Linking a Mixed C++ & Ada Program
 @subsection Linking a Mixed C++ & Ada Program
@@ -2998,16 +3014,17 @@ $ gnatmake ada_unit -largs file1.o file2.o --LINK=c++
 
 @item
 Using GNAT and G++ from two different GCC installations: If both
-compilers are on the PATH, the previous method may be used. It is
-important to note that environment variables such as C_INCLUDE_PATH,
-GCC_EXEC_PREFIX, BINUTILS_ROOT, and GCC_ROOT will affect both compilers
+compilers are on the @env{PATH}, the previous method may be used. It is
+important to note that environment variables such as
+@env{C_INCLUDE_PATH}, @env{GCC_EXEC_PREFIX}, @env{BINUTILS_ROOT}, and
+@env{GCC_ROOT} will affect both compilers
 at the same time and may make one of the two compilers operate
 improperly if set during invocation of the wrong compiler.  It is also
 very important that the linker uses the proper @file{libgcc.a} GCC
 library -- that is, the one from the C++ compiler installation. The
-implicit link command as suggested in the gnatmake command from the
-former example can be replaced by an explicit link command with the
-full-verbosity option in order to verify which library is used:
+implicit link command as suggested in the @command{gnatmake} command
+from the former example can be replaced by an explicit link command with
+the full-verbosity option in order to verify which library is used:
 @smallexample
 $ gnatbind ada_unit
 $ gnatlink -v -v ada_unit file1.o file2.o --LINK=c++
@@ -3045,7 +3062,7 @@ $ gnatlink ada_unit file1.o file2.o --LINK=./my_script
 Where CC is the name of the non-GNU C++ compiler.
 
 If the @code{zero cost} exception mechanism is used, and the platform
-supports automatic registration of exception tables (e.g. Solaris or IRIX),
+supports automatic registration of exception tables (e.g.@: Solaris or IRIX),
 paths to more objects are required:
 
 @smallexample
@@ -3058,7 +3075,7 @@ $ gnatlink ada_unit file1.o file2.o --LINK=./my_script
 @end smallexample
 
 If the @code{zero cost} exception mechanism is used, and the platform
-doesn't support automatic registration of exception tables (e.g. HP-UX,
+doesn't support automatic registration of exception tables (e.g.@: HP-UX,
 Tru64 or AIX), the simple approach described above will not work and
 a pre-linking phase using GNAT will be necessary.
 
@@ -3396,10 +3413,10 @@ finalizing the Ada run-time system along the way:
 @b{#include} <iostream>
 @b{using namespace} std;
 
-void Check_Carnivore (Carnivore *obj) @{ ... @}
-void Check_Domestic (Domestic *obj)   @{ ... @}
-void Check_Animal (Animal *obj)       @{ ... @}
-void Check_Dog (Dog *obj)             @{ ... @}
+void Check_Carnivore (Carnivore *obj) @{@dots{}@}
+void Check_Domestic (Domestic *obj)   @{@dots{}@}
+void Check_Animal (Animal *obj)       @{@dots{}@}
+void Check_Dog (Dog *obj)             @{@dots{}@}
 
 @b{extern} "C" @{
   void adainit (void);
@@ -3608,7 +3625,7 @@ compiled.
 
 @cindex cannot generate code
 If you attempt to compile any of these files, you will get one of the
-following error messages (where fff is the name of the file you compiled):
+following error messages (where @var{fff} is the name of the file you compiled):
 
 @smallexample
 cannot generate code for file @var{fff} (package spec)
@@ -3733,9 +3750,10 @@ system configuration. You must have a GNAT cross-compiler built if
 @cindex @option{-B} (@command{gcc})
 Load compiler executables (for example, @code{gnat1}, the Ada compiler)
 from @var{dir} instead of the default location. Only use this switch
-when multiple versions of the GNAT compiler are available. See the
-@command{gcc} manual page for further details. You would normally use the
-@option{-b} or @option{-V} switch instead.
+when multiple versions of the GNAT compiler are available.
+@xref{Directory Options,, Options for Directory Search, gcc, Using the
+GNU Compiler Collection (GCC)}, for further details. You would normally
+use the @option{-b} or @option{-V} switch instead.
 
 @item -c
 @cindex @option{-c} (@command{gcc})
@@ -3755,7 +3773,9 @@ Suppresses all back-end inlining, even if other optimization or inlining
 switches are set.
 This includes suppression of inlining that results
 from the use of the pragma @code{Inline_Always}.
-See also @option{-gnatn} and @option{-gnatN}.
+Any occurrences of pragma @code{Inline} or @code{Inline_Always}
+are ignored, and @option{-gnatn} and @option{-gnatN} have no
+effect if this switch is present.
 
 @item -fno-strict-aliasing
 @cindex @option{-fno-strict-aliasing} (@command{gcc})
@@ -3806,7 +3826,7 @@ configuration pragmas @code{Assertion_Policy} and @code{Debug_Policy}.
 
 @item -gnatA
 @cindex @option{-gnatA} (@command{gcc})
-Avoid processing @file{gnat.adc}. If a gnat.adc file is present,
+Avoid processing @file{gnat.adc}. If a @file{gnat.adc} file is present,
 it will be ignored.
 
 @item -gnatb
@@ -3907,7 +3927,7 @@ Identifier character set
 For details of the possible selections for @var{c},
 see @ref{Character Set Control}.
 
-@item ^-gnatI^IGNORE_REP_CLAUSES^
+@item ^-gnatI^/IGNORE_REP_CLAUSES^
 @cindex @option{^-gnatI^IGNORE_REP_CLAUSES^} (@command{gcc})
 Ignore representation clauses. When this switch is used, all
 representation clauses are treated as comments. This is useful
@@ -3975,8 +3995,8 @@ Suppress all checks.
 @cindex @option{-gnatP} (@command{gcc})
 Enable polling. This is required on some systems (notably Windows NT) to
 obtain asynchronous abort and asynchronous transfer of control capability.
-See the description of pragma Polling in the GNAT Reference Manual for
-full details.
+@xref{Pragma Polling,,, gnat_rm, GNAT Reference Manual}, for full
+details.
 
 @item -gnatq
 @cindex @option{-gnatq} (@command{gcc})
@@ -4023,7 +4043,7 @@ Verbose mode. Full error output with source lines to @file{stdout}.
 Control level of validity checking. See separate section describing
 this feature.
 
-@item ^-gnatw@var{xxx}^/WARNINGS=(@var{option}[,...])^
+@item ^-gnatw@var{xxx}^/WARNINGS=(@var{option}[,@dots{}])^
 @cindex @option{^-gnatw^/WARNINGS^} (@command{gcc})
 Warning mode where
 ^@var{xxx} is a string of option letters that^the list of options^ denotes
@@ -4044,7 +4064,7 @@ Wide character encoding method
 @cindex @option{-gnatx} (@command{gcc})
 Suppress generation of cross-reference information.
 
-@item ^-gnaty^/STYLE_CHECKS=(option,option..)^
+@item ^-gnaty^/STYLE_CHECKS=(option,option@dots{})^
 @cindex @option{^-gnaty^/STYLE_CHECKS^} (@command{gcc})
 Enable built-in style checks (@pxref{Style Checking}).
 
@@ -4139,7 +4159,7 @@ Equivalent to @option{/OPTIMIZE=NONE}.
 This is the default behavior in the absence of an @option{/OPTIMIZE}
 qualifier.
 
-@item /OPTIMIZE[=(keyword[,...])]
+@item /OPTIMIZE[=(keyword[,@dots{}])]
 @cindex @option{/OPTIMIZE} (@code{GNAT COMPILE})
 Selects the level of optimization for your program. The supported
 keywords are as follows:
@@ -4215,7 +4235,7 @@ Execute @var{ver} version of the compiler. This is the @command{gcc}
 version, not the GNAT version.
 @end ifclear
 
-@item ^-w^NO_BACK_END_WARNINGS^
+@item ^-w^/NO_BACK_END_WARNINGS^
 @cindex @option{-w} (@command{gcc})
 Turn off warnings generated by the back end of the compiler. Use of
 this switch also causes the default for front end warnings to be set
@@ -4395,7 +4415,7 @@ warning messages generated.
 
 @item -^gnatl^OUTPUT_FILE^=file
 @cindex @option{^-gnatl^OUTPUT_FILE^=fname} (@command{gcc})
-This has the same effect as @code{-gnatl} except that the output is
+This has the same effect as @option{-gnatl} except that the output is
 written to a file instead of to standard output. If the given name
 @file{fname} does not start with a period, then it is the full name
 of the file to be written. If @file{fname} is an extension, it is
@@ -4519,7 +4539,7 @@ illegalities are detected in the program. The use of @option{-gnatQ} forces
 generation of the @file{ALI} file. This file is marked as being in
 error, so it cannot be used for binding purposes, but it does contain
 reasonably complete cross-reference information, and thus may be useful
-for use by tools (e.g. semantic browsing tools or integrated development
+for use by tools (e.g., semantic browsing tools or integrated development
 environments) that are driven from the @file{ALI} file. This switch
 implies @option{-gnatq}, since the semantic phase must be run to get a
 meaningful ALI file.
@@ -4583,6 +4603,9 @@ Out-of-range values being assigned
 Possible order of elaboration problems
 
 @item
+Assertions (pragma Assert) that are sure to fail
+
+@item
 Unreachable code
 
 @item
@@ -4709,8 +4732,8 @@ A range in a @code{for} loop that is known to be null or might be null
 The following section lists compiler switches that are available
 to control the handling of warning messages. It is also possible
 to exercise much finer control over what warnings are issued and
-suppressed using the GNAT pragma Warnings, which is documented
-in the GNAT Reference manual.
+suppressed using the GNAT pragma Warnings, @xref{Pragma Warnings,,,
+gnat_rm, GNAT Reference manual}.
 
 @table @option
 @c !sort!
@@ -4724,6 +4747,7 @@ switch are
 @option{-gnatwd} (implicit dereferencing),
 @option{-gnatwh} (hiding),
 @option{-gnatwl} (elaboration warnings),
+@option{-gnatw.o} (warn on values set by out parameters ignored)
 and @option{-gnatwt} (tracking of deleted conditional code).
 All other optional warnings are turned on.
 
@@ -4734,6 +4758,22 @@ This switch suppresses all optional warning messages, see remaining list
 in this section for details on optional warning messages that can be
 individually controlled.
 
+@item -gnatw.a
+@emph{Activate warnings on failing assertions.}
+@cindex @option{-gnatw.a} (@command{gcc})
+@cindex Assert failures
+This switch activates warnings for assertions where the compiler can tell at
+compile time that the assertion will fail. Note that this warning is given
+even if assertions are disabled. The default is that such warnings are
+generated.
+
+@item -gnatw.A
+@emph{Suppress warnings on failing assertions.}
+@cindex @option{-gnatw.A} (@command{gcc})
+@cindex Assert failures
+This switch suppresses warnings for assertions where the compiler can tell at
+compile time that the assertion will fail.
+
 @item -gnatwb
 @emph{Activate warnings on bad fixed values.}
 @cindex @option{-gnatwb} (@command{gcc})
@@ -5012,6 +5052,27 @@ This switch suppresses warnings on possibly unintended initialization
 effects of defining address clauses that cause one variable to overlap
 another.
 
+@item -gnatw.o
+@emph{Activate warnings on modified but unreferenced out parameters.}
+@cindex @option{-gnatw.o} (@command{gcc})
+This switch activates warnings for variables that are modified by using
+them as actuals for a call to a procedure with an out mode formal, where
+the resulting assigned value is never read. It is applicable in the case
+where there is more than one out mode formal. If there is only one out
+mode formal, the warning is issued by default (controlled by -gnatwu).
+The warning is suppressed for volatile
+variables and also for variables that are renamings of other variables
+or for which an address clause is given.
+The default is that these warnings are not given. Note that this warning
+is not included in -gnatwa, it must be activated explicitly.
+
+@item -gnatw.O
+@emph{Disable warnings on modified but unreferenced out parameters.}
+@cindex @option{-gnatw.O} (@command{gcc})
+This switch suppresses warnings for variables that are modified by using
+them as actuals for a call to a procedure with an out mode formal, where
+the resulting assigned value is never read.
+
 @item -gnatwp
 @emph{Activate warnings on ineffective pragma Inlines.}
 @cindex @option{-gnatwp} (@command{gcc})
@@ -5180,16 +5241,34 @@ This warning can also be turned on using @option{-gnatwa}.
 @item -gnatwW
 @emph{Suppress warnings on wrong low bound assumption.}
 @cindex @option{-gnatwW} (@command{gcc})
-This switch activates warnings for indexing an unconstrained string parameter
-with a literal or S'Length. This warning can also be suppressed by providing
-an Assert pragma that checks the low bound, for example:
+This switch suppresses warnings for indexing an unconstrained string parameter
+with a literal or S'Length. Note that this warning can also be suppressed
+in a particular case by adding an
+assertion that the lower bound is 1,
+as shown in the following example.
 
 @smallexample @c ada
    procedure K (S : String) is
       pragma Assert (S'First = 1);
-      ...
+      @dots{}
 @end smallexample
 
+@item -gnatw.w
+@emph{Activate warnings on unnecessary Warnings Off pragmas}
+@cindex @option{-gnatw.w} (@command{gcc})
+@cindex Warnings Off control
+This switch activates warnings for use of @code{pragma Warnings (Off, entity}
+where either the pragma is entirely useless (because it suppresses no
+warnings), or it could be replaced by @code{pragma Unreferenced} or
+@code{pragma Unmodified}.The default is that these warnings are not given.
+Note that this warning is not included in -gnatwa, it must be
+activated explicitly.
+
+@item -gnatw.W
+@emph{Suppress warnings on unnecessary Warnings Off pragmas}
+@cindex @option{-gnatw.W} (@command{gcc})
+This switch suppresses warnings for use of @code{pragma Warnings (Off, entity}.
+
 @item -gnatwx
 @emph{Activate warnings on Export/Import pragmas.}
 @cindex @option{-gnatwx} (@command{gcc})
@@ -5252,7 +5331,9 @@ incompatibilities between Ada 95 and Ada 2005.
 This switch activates warnings for unchecked conversions
 where the types are known at compile time to have different
 sizes. The default
-is that such warnings are generated.
+is that such warnings are generated. Warnings are also
+generated for subprogram pointers with different conventions,
+and, on VMS only, for data pointers with different conventions.
 This warning can also be turned on using @option{-gnatwa}.
 
 @item -gnatwZ
@@ -5260,7 +5341,7 @@ This warning can also be turned on using @option{-gnatwa}.
 @cindex @option{-gnatwZ} (@command{gcc})
 This switch suppresses warnings for unchecked conversions
 where the types are known at compile time to have different
-sizes.
+sizes or conventions.
 
 @item ^-Wuninitialized^WARNINGS=UNINITIALIZED^
 @cindex @option{-Wuninitialized}
@@ -5463,9 +5544,9 @@ are assigned component by component.
 @cindex @option{-gnatVf} (@command{gcc})
 In the absence of this switch, validity checking occurs only for discrete
 values. If @option{-gnatVf} is specified, then validity checking also applies
-for floating-point values, and NaN's and infinities are considered invalid,
+for floating-point values, and NaNs and infinities are considered invalid,
 as well as out of range values for constrained types. Note that this means
-that standard @code{IEEE} infinity mode is not allowed. The exact contexts
+that standard IEEE infinity mode is not allowed. The exact contexts
 in which floating-point values are checked depends on the setting of other
 options. For example,
 @option{^-gnatVif^VALIDITY_CHECKING=(IN_PARAMS,FLOATS)^} or
@@ -5508,7 +5589,7 @@ the shift operators defined as intrinsic in package @code{Interfaces}
 and operands for attributes such as @code{Pos}. Checks are also made
 on individual component values for composite comparisons, and on the
 expressions in type conversions and qualified expressions. Checks are
-also made on explicit ranges using .. (e.g. slices, loops etc).
+also made on explicit ranges using @samp{..} (e.g.@: slices, loops etc).
 
 @item -gnatVp
 @emph{Validity checks for parameters.}
@@ -5594,7 +5675,7 @@ temporary disabling of validity checks.
 @findex Style checking
 
 @noindent
-The @option{-gnaty^x^(option,option,...)^} switch
+The @option{-gnaty^x^(option,option,@dots{})^} switch
 @cindex @option{-gnaty} (@command{gcc})
 causes the compiler to
 enforce specified style rules. A limited set of style rules has been used
@@ -5603,7 +5684,7 @@ to activate all or some of these checks. If the source program fails a
 specified style check, an appropriate warning message is given, preceded by
 the character sequence ``(style)''.
 @ifset vms
-@code{(option,option,...)} is a sequence of keywords
+@code{(option,option,@dots{})} is a sequence of keywords
 @end ifset
 @ifclear vms
 The string @var{x} is a sequence of letters or digits
@@ -5622,7 +5703,9 @@ indentation level required.
 The general style of required indentation is as specified by
 the examples in the Ada Reference Manual. Full line comments must be
 aligned with the @code{--} starting on a column that is a multiple of
-the alignment level.
+the alignment level, or they may be aligned the same way as the following
+non-blank line (this is useful when full line comments appear in the middle
+of a statement.
 
 @item ^a^ATTRIBUTE^
 @emph{Check attribute casing.}
@@ -5677,9 +5760,9 @@ including @command{gnatprep} (where ``@code{--!}'' is used) and the SPARK
 annotation
 language (where ``@code{--#}'' is used). For the purposes of this rule, a
 special character is defined as being in one of the ASCII ranges
-@code{16#21#..16#2F#} or @code{16#3A#..16#3F#}.
+@code{16#21#@dots{}16#2F#} or @code{16#3A#@dots{}16#3F#}.
 Note that this usage is not permitted
-in GNAT implementation units (i.e. when @option{-gnatg} is used).
+in GNAT implementation units (i.e., when @option{-gnatg} is used).
 
 @item
 A line consisting entirely of minus signs, possibly preceded by blanks, is
@@ -5869,10 +5952,10 @@ to match the presentation in the Ada Reference Manual (for example,
 @emph{Check order of subprogram bodies.}
 If the ^letter o^word ORDERED_SUBPROGRAMS^ appears in the string
 after @option{-gnaty} then all subprogram bodies in a given scope
-(e.g. a package body) must be in alphabetical order. The ordering
+(e.g.@: a package body) must be in alphabetical order. The ordering
 rule uses normal Ada rules for comparing strings, ignoring casing
 of letters, except that if there is a trailing numeric suffix, then
-the value of this suffix is used in the ordering (e.g. Junk2 comes
+the value of this suffix is used in the ordering (e.g.@: Junk2 comes
 before Junk10).
 
 @item ^p^PRAGMA^
@@ -6063,7 +6146,7 @@ X2 : Integer range 1 .. 5 := 5;
 X3 : Integer := Integer'Last;
 X4 : Integer range 1 .. 5 := 5;
 F  : Float := 2.0E+20;
-...
+@dots{}
 X1 := X1 + 1;
 X2 := X2 + 1;
 X3 := Integer (F);
@@ -6411,15 +6494,20 @@ For full details on these encoding
 methods see @ref{Wide Character Encodings}.
 Note that brackets coding is always accepted, even if one of the other
 options is specified, so for example @option{-gnatW8} specifies that both
-brackets and @code{UTF-8} encodings will be recognized. The units that are
+brackets and UTF-8 encodings will be recognized. The units that are
 with'ed directly or indirectly will be scanned using the specified
 representation scheme, and so if one of the non-brackets scheme is
 used, it must be used consistently throughout the program. However,
 since brackets encoding is always recognized, it may be conveniently
 used in standard libraries, allowing these libraries to be used with
 any of the available coding schemes.
-scheme. If no @option{-gnatW?} parameter is present, then the default
-representation is Brackets encoding only.
+scheme.
+
+If no @option{-gnatW?} parameter is present, then the default
+representation is normally Brackets encoding only. However, if the
+first three characters of the file are 16#EF# 16#BB# 16#BF# (the standard
+byte order mark or BOM for UTF-8), then these three characters are
+skipped and the default representation for the file is set to UTF-8.
 
 Note that the wide character representation that is specified (explicitly
 or by default) for the main program also acts as the default encoding used
@@ -6549,7 +6637,7 @@ into calls to the tasking run-time routines. A unique capability of GNAT
 is to list this expanded code in a form very close to normal Ada source.
 This is very useful in understanding the implications of various Ada
 usage on the efficiency of the generated code. There are many cases in
-Ada (e.g. the use of controlled types), where simple Ada statements can
+Ada (e.g.@: the use of controlled types), where simple Ada statements can
 generate a lot of run-time code. By using @option{-gnatG} you can identify
 these cases, and consider whether it may be desirable to modify the coding
 approach to improve efficiency.
@@ -6618,7 +6706,7 @@ An implicit call to a run-time support routine
 (to meet the requirement of H.3.1(9) in a
 convenient manner).
 
-@item @var{expr} && @var{expr} && @var{expr} ... && @var{expr}
+@item @var{expr} && @var{expr} && @var{expr} @dots{} && @var{expr}
 A multiple concatenation (same effect as @var{expr} & @var{expr} &
 @var{expr}, but handled more efficiently).
 
@@ -6675,13 +6763,13 @@ the @option{-gnatR} switch). For @option{-gnatR1} (which is the default,
 so @option{-gnatR} with no parameter has the same effect), size and alignment
 information is listed for declared array and record types. For
 @option{-gnatR2}, size and alignment information is listed for all
-declared types and objects. Finally @code{-gnatR3} includes symbolic
+declared types and objects. Finally @option{-gnatR3} includes symbolic
 expressions for values that are computed at run time for
 variant records. These symbolic expressions have a mostly obvious
 format with #n being used to represent the value of the n'th
 discriminant. See source files @file{repinfo.ads/adb} in the
 @code{GNAT} sources for full details on the format of @option{-gnatR3}
-output. If the switch is followed by an s (e.g. @option{-gnatR2s}), then
+output. If the switch is followed by an s (e.g.@: @option{-gnatR2s}), then
 the output is to a file with the name @file{^file.rep^file_REP^} where
 file is the name of the corresponding source file.
 @end ifclear
@@ -6704,7 +6792,7 @@ discriminant. See source files @file{REPINFO.ADS/ADB} in the
 @code{GNAT} sources for full details on the format of
 @option{/REPRESENTATION_INFO=SYMBOLIC} output.
 If _FILE is added at the end of an option
-(e.g. @option{/REPRESENTATION_INFO=ARRAYS_FILE}),
+(e.g.@: @option{/REPRESENTATION_INFO=ARRAYS_FILE}),
 then the output is to a file with the name @file{file_REP} where
 file is the name of the corresponding source file.
 @end ifset
@@ -6840,8 +6928,8 @@ Example:
 
 When the switch @option{-gnatem} is specified, the compiler will create
 in memory the two mappings from the specified file. If there is any problem
-(non existent file, truncated file or duplicate entries), no mapping
-will be created.
+(nonexistent file, truncated file or duplicate entries), no mapping will
+be created.
 
 Several @option{-gnatem} switches may be specified; however, only the last
 one on the command line will be taken into account.
@@ -6855,7 +6943,8 @@ and communicates it to the compiler using this switch.
 @subsection Integrated Preprocessing
 
 @noindent
-GNAT sources may be preprocessed immediately before compilation; the actual
+GNAT sources may be preprocessed immediately before compilation.
+In this case, the actual
 text of the source is not the text of the source file, but is derived from it
 through a process called preprocessing. Integrated preprocessing is specified
 through switches @option{-gnatep} and/or @option{-gnateD}. @option{-gnatep}
@@ -6863,6 +6952,13 @@ indicates, through a text file, the preprocessing data to be used.
 @option{-gnateD} specifies or modifies the values of preprocessing symbol.
 
 @noindent
+Note that when integrated preprocessing is used, the output from the
+preprocessor is not written to any external file. Instead it is passed
+internally to the compiler. If you need to preserve the result of
+preprocessing in a file, then you should use @command{gnatprep}
+to perform the desired preprocessing in stand-alone mode.
+
+@noindent
 It is recommended that @command{gnatmake} switch ^-s^/SWITCH_CHECK^ should be
 used when Integrated Preprocessing is used. The reason is that preprocessing
 with another Preprocessing Data file without changing the sources will
@@ -6890,7 +6986,7 @@ should be found in the source directories.
 @noindent
 A preprocessing data file is a text file with significant lines indicating
 how should be preprocessed either a specific source or all sources not
-mentioned in other lines. A significant line is a non empty, non comment line.
+mentioned in other lines. A significant line is a nonempty, non-comment line.
 Comments are similar to Ada comments.
 
 @noindent
@@ -6993,9 +7089,9 @@ This switch is similar to switch @option{^-D^/ASSOCIATE^} of @code{gnatprep}.
 The GCC technology provides a wide range of target dependent
 @option{-m} switches for controlling
 details of code generation with respect to different versions of
-architectures. This includes variations in instruction sets (e.g.
+architectures. This includes variations in instruction sets (e.g.@:
 different members of the power pc family), and different requirements
-for optimal arrangement of instructions (e.g. different members of
+for optimal arrangement of instructions (e.g.@: different members of
 the x86 family). The list of available @option{-m} switches may be
 found in the GCC documentation.
 
@@ -7022,7 +7118,7 @@ unless you actually see a performance improvement.
 
 @noindent
 On VMS, GNAT compiled programs return POSIX-style codes by default,
-e.g. @option{/RETURN_CODES=POSIX}.
+e.g.@: @option{/RETURN_CODES=POSIX}.
 
 To enable VMS style return codes, use GNAT BIND and LINK with the option
 @option{/RETURN_CODES=VMS}. For example:
@@ -7065,20 +7161,20 @@ Each directory named by an @option{^-I^/SOURCE_SEARCH^} switch given on the
 @item
 @findex ADA_PRJ_INCLUDE_FILE
 Each of the directories listed in the text file whose name is given
-by the @code{ADA_PRJ_INCLUDE_FILE} ^environment variable^logical name^.
+by the @env{ADA_PRJ_INCLUDE_FILE} ^environment variable^logical name^.
 
 @noindent
-@code{ADA_PRJ_INCLUDE_FILE} is normally set by gnatmake or by the ^gnat^GNAT^
+@env{ADA_PRJ_INCLUDE_FILE} is normally set by gnatmake or by the ^gnat^GNAT^
 driver when project files are used. It should not normally be set
 by other means.
 
 @item
 @findex ADA_INCLUDE_PATH
 Each of the directories listed in the value of the
-@code{ADA_INCLUDE_PATH} ^environment variable^logical name^.
+@env{ADA_INCLUDE_PATH} ^environment variable^logical name^.
 @ifclear vms
 Construct this value
-exactly as the @code{PATH} environment variable: a list of directory
+exactly as the @env{PATH} environment variable: a list of directory
 names separated by colons (semicolons when working with the NT version).
 @end ifclear
 @ifset vms
@@ -7145,8 +7241,8 @@ the built-in defaults cause these files to be found.
 In addition to the language-defined hierarchies (@code{System}, @code{Ada} and
 @code{Interfaces}), the GNAT distribution provides a fourth hierarchy,
 consisting of child units of @code{GNAT}. This is a collection of generally
-useful types, subprograms, etc. See the @cite{GNAT Reference Manual} for
-further details.
+useful types, subprograms, etc. @xref{Top, GNAT Reference Manual, About
+This Guid, gnat_rm, GNAT Reference Manual}, for further details.
 
 Besides simplifying access to the RTL, a major use of search paths is
 in compiling sources from multiple directories. This can make
@@ -7375,6 +7471,15 @@ be presented in subsequent sections.
 @table @option
 @c !sort!
 
+@item --version
+@cindex @option{--version} @command{gnatbind}
+Display Copyright and version, then exit disregarding all other options.
+
+@item --help
+@cindex @option{--help} @command{gnatbind}
+If @option{--version} was not used, display usage, then exit disregarding
+all other options.
+
 @item -a
 @cindex @option{-a} @command{gnatbind}
 Indicates that, if supported by the platform, the adainit procedure should
@@ -7489,12 +7594,12 @@ ALI file named in the @code{gnatbind} command line.
 @cindex @option{^-l^/ORDER_OF_ELABORATION^} (@command{gnatbind})
 Output chosen elaboration order.
 
-@item ^-Lxxx^/BUILD_LIBRARY=xxx^
+@item ^-L@var{xxx}^/BUILD_LIBRARY=@var{xxx}^
 @cindex @option{^-L^/BUILD_LIBRARY^} (@command{gnatbind})
 Bind the units for library building. In this case the adainit and
 adafinal procedures (@pxref{Binding with Non-Ada Main Programs})
-are renamed to ^xxxinit^XXXINIT^ and
-^xxxfinal^XXXFINAL^.
+are renamed to ^@var{xxx}init^@var{XXX}INIT^ and
+^@var{xxx}final^@var{XXX}FINAL^.
 Implies ^-n^/NOCOMPILE^.
 @ifclear vms
 (@xref{GNAT and Libraries}, for more details.)
@@ -7569,15 +7674,15 @@ The @var{xxx} ^string specified with the switch^option^ may be either
 @item ``@option{^in^INVALID^}'' requesting an invalid value where possible
 @item ``@option{^lo^LOW^}'' for the lowest possible value
 @item ``@option{^hi^HIGH^}'' for the highest possible value
-@item ``@option{xx}'' for a value consisting of repeated bytes with the
-value 16#xx# (i.e. xx is a string of two hexadecimal digits).
+@item ``@option{@var{xx}}'' for a value consisting of repeated bytes with the
+value @code{16#@var{xx}#} (i.e., @var{xx} is a string of two hexadecimal digits).
 @end itemize
 
 In addition, you can specify @option{-Sev} to indicate that the value is
 to be set at run time. In this case, the program will look for an environment
 @cindex GNAT_INIT_SCALARS
-variable of the form @code{GNAT_INIT_SCALARS=xx}, where xx is one
-of @option{in/lo/hi/xx} with the same meanings as above.
+variable of the form @env{GNAT_INIT_SCALARS=@var{xx}}, where @var{xx} is one
+of @option{in/lo/hi/@var{xx}} with the same meanings as above.
 If no environment variable is found, or if it does not have a valid value,
 then the default is @option{in} (invalid values).
 
@@ -7611,9 +7716,11 @@ scheduling policy to @code{FIFO_Within_Priorities}.
 
 @item ^-u@var{n}^/DYNAMIC_STACK_USAGE=@var{n}^
 @cindex @option{^-u^/DYNAMIC_STACK_USAGE^} (@code{gnatbind})
-Enable dynamic stack usage, with n result stored and displayed at program
-termination. Results that can't be stored are displayed on the fly, at task
-termination. This option is currently not supported on OpenVMS I64 platforms.
+Enable dynamic stack usage, with @var{n} results stored and displayed
+at program termination. A result is generated when a task
+terminates. Results that can't be stored are displayed on the fly, at
+task termination. This option is currently not supported on Itanium
+platforms. (See @ref{Dynamic Stack Usage Analysis} for details.)
 
 @item ^-v^/REPORT_ERRORS=VERBOSE^
 @cindex @option{^-v^/REPORT_ERRORS=VERBOSE^} (@code{gnatbind})
@@ -7640,6 +7747,10 @@ All warning messages are suppressed
 Warning messages are treated as fatal errors
 @end ifset
 
+@item ^-Wx^/WIDE_CHARACTER_ENCODING=^@var{e}
+@cindex @option{^-Wx^/WIDE_CHARACTER_ENCODING^} (@code{gnatbind})
+Override default wide character encoding for standard Text_IO files.
+
 @item ^-x^/READ_SOURCES=NONE^
 @cindex @option{^-x^/READ_SOURCES^} (@code{gnatbind})
 Exclude source files (check object consistency only).
@@ -7651,6 +7762,10 @@ Default mode, in which sources are checked for consistency only if
 they are available.
 @end ifset
 
+@item ^-y^/ENABLE_LEAP_SECONDS^
+@cindex @option{^-y^/ENABLE_LEAP_SECONDS^} (@code{gnatbind})
+Enable leap seconds support in @code{Ada.Calendar} and its children.
+
 @item ^-z^/ZERO_MAIN^
 @cindex @option{^-z^/ZERO_MAIN^} (@code{gnatbind})
 No main subprogram.
@@ -7681,6 +7796,16 @@ their consistency. In normal mode, if a source file cannot be located it
 is simply ignored. If you specify this switch, a missing source
 file is an error.
 
+@item ^-Wx^/WIDE_CHARACTER_ENCODING=^@var{e}
+@cindex @option{^-Wx^/WIDE_CHARACTER_ENCODING^} (@code{gnatbind})
+Override default wide character encoding for standard Text_IO files.
+Normally the default wide character encoding method used for standard
+[Wide_[Wide_]]Text_IO files is taken from the encoding specified for
+the main source input (see description of switch
+@option{^-gnatWx^/WIDE_CHARACTER_ENCODING^} for the compiler). The
+use of this switch for the binder (which has the same set of
+possible arguments) overrides this default as specified.
+
 @item ^-x^/READ_SOURCES=NONE^
 @cindex @option{^-x^/READ_SOURCES=NONE^} (@code{gnatbind})
 Exclude source files. In this mode, the binder only checks that ALI
@@ -7692,7 +7817,7 @@ specify this switch, the binder will not detect that the object
 file is out of date with respect to the source file. Note that this is the
 mode that is automatically used by @command{gnatmake} because in this
 case the checking against sources has already been performed by
-@command{gnatmake} in the course of compilation (i.e. before binding).
+@command{gnatmake} in the course of compilation (i.e.@: before binding).
 
 @ifset vms
 @item /READ_SOURCES=AVAILABLE
@@ -7981,7 +8106,11 @@ The following switch is used to bind programs organized in this manner:
 Normally the binder checks that the unit name given on the command line
 corresponds to a suitable main subprogram. When this switch is used,
 a list of ALI files can be given, and the execution of the program
-consists of elaboration of these units in an appropriate order.
+consists of elaboration of these units in an appropriate order. Note
+that the default wide character encoding method for standard Text_IO
+files is always set to Brackets if this switch is set (you can use
+the binder switch
+@option{^-Wx^WIDE_CHARACTER_ENCODING^} to override this default).
 @end table
 
 @node Command-Line Access
@@ -8038,20 +8167,20 @@ command line, in the order given.
 @item
 @findex ADA_PRJ_OBJECTS_FILE
 Each of the directories listed in the text file whose name is given
-by the @code{ADA_PRJ_OBJECTS_FILE} ^environment variable^logical name^.
+by the @env{ADA_PRJ_OBJECTS_FILE} ^environment variable^logical name^.
 
 @noindent
-@code{ADA_PRJ_OBJECTS_FILE} is normally set by gnatmake or by the ^gnat^GNAT^
+@env{ADA_PRJ_OBJECTS_FILE} is normally set by gnatmake or by the ^gnat^GNAT^
 driver when project files are used. It should not normally be set
 by other means.
 
 @item
 @findex ADA_OBJECTS_PATH
 Each of the directories listed in the value of the
-@code{ADA_OBJECTS_PATH} ^environment variable^logical name^.
+@env{ADA_OBJECTS_PATH} ^environment variable^logical name^.
 @ifset unw
 Construct this value
-exactly as the @code{PATH} environment variable: a list of directory
+exactly as the @env{PATH} environment variable: a list of directory
 names separated by colons (semicolons when working with the NT version
 of GNAT).
 @end ifset
@@ -8242,13 +8371,13 @@ units, or in @code{Import} pragmas in any Ada units.
 
 @var{linker options} is an optional list of linker specific
 switches.
-The default linker called by gnatlink is @var{gcc} which in
+The default linker called by gnatlink is @command{gcc} which in
 turn calls the appropriate system linker.
 Standard options for the linker such as @option{-lmy_lib} or
 @option{-Ldir} can be added as is.
 For options that are not recognized by
-@var{gcc} as linker options, use the @var{gcc} switches @option{-Xlinker} or
-@option{-Wl,}.
+@command{gcc} as linker options, use the @command{gcc} switches
+@option{-Xlinker} or @option{-Wl,}.
 Refer to the GCC documentation for
 details. Here is an example showing how to generate a linker map:
 
@@ -8271,9 +8400,9 @@ presented to the linker.
 
 @ifset vms
 @command{gnatlink} accepts the following types of extra files on the command
-line: objects (.OBJ), libraries (.OLB), sharable images (.EXE), and
-options files (.OPT). These are recognized and handled according to their
-extension.
+line: objects (@file{.OBJ}), libraries (@file{.OLB}), sharable images
+(@file{.EXE}), and options files (@file{.OPT}). These are recognized and
+handled according to their extension.
 @end ifset
 
 @node Switches for gnatlink
@@ -8285,6 +8414,15 @@ The following switches are available with the @command{gnatlink} utility:
 @table @option
 @c !sort!
 
+@item --version
+@cindex @option{--version} @command{gnatlink}
+Display Copyright and version, then exit disregarding all other options.
+
+@item --help
+@cindex @option{--help} @command{gnatlink}
+If @option{--version} was not used, display usage, then exit disregarding
+all other options.
+
 @item ^-A^/BIND_FILE=ADA^
 @cindex @option{^-A^/BIND_FILE=ADA^} (@command{gnatlink})
 The binder has generated code in Ada. This is the default.
@@ -8355,9 +8493,10 @@ system configuration. You must have a GNAT cross-compiler built if
 @cindex @option{-B} (@command{gnatlink})
 Load compiler executables (for example, @code{gnat1}, the Ada compiler)
 from @var{dir} instead of the default location. Only use this switch
-when multiple versions of the GNAT compiler are available. See the
-@command{gcc} manual page for further details. You would normally use the
-@option{-b} or @option{-V} switch instead.
+when multiple versions of the GNAT compiler are available.
+@xref{Directory Options,,, gcc, The GNU Compiler Collection},
+for further details. You would normally use the @option{-b} or
+@option{-V} switch instead.
 
 @item --GCC=@var{compiler_name}
 @cindex @option{--GCC=compiler_name} (@command{gnatlink})
@@ -8490,7 +8629,7 @@ If @code{switches} are present, they can be placed before the first
 If @var{mode_switches} are present, they must always be placed after
 the last @var{file_name} and all @code{switches}.
 
-If you are using standard file extensions (.adb and .ads), then the
+If you are using standard file extensions (@file{.adb} and @file{.ads}), then the
 extension may be omitted from the @var{file_name} arguments. However, if
 you are using non-standard extensions, then it is required that the
 extension be given. A relative or absolute directory path can be
@@ -8515,6 +8654,16 @@ You may specify any of the following switches to @command{gnatmake}:
 
 @table @option
 @c !sort!
+
+@item --version
+@cindex @option{--version} @command{gnatmake}
+Display Copyright and version, then exit disregarding all other options.
+
+@item --help
+@cindex @option{--help} @command{gnatmake}
+If @option{--version} was not used, display usage, then exit disregarding
+all other options.
+
 @ifclear vms
 @item --GCC=@var{compiler_name}
 @cindex @option{--GCC=compiler_name} (@command{gnatmake})
@@ -8728,7 +8877,7 @@ stamp differences when the only
 modifications to a source file consist in adding/removing comments,
 empty lines, spaces or tabs. This means that if you have changed the
 comments in a source file or have simply reformatted it, using this
-switch will tell gnatmake not to recompile files that depend on it
+switch will tell @command{gnatmake} not to recompile files that depend on it
 (provided other sources on which these files depend have undergone no
 semantic modifications). Note that the debugging information may be
 out of date with respect to the sources if the @option{-m} switch causes
@@ -8866,7 +9015,7 @@ then the finalization routines.
 @item @command{gcc} @asis{switches}
 @ifclear vms
 Any uppercase or multi-character switch that is not a @command{gnatmake} switch
-is passed to @command{gcc} (e.g. @option{-O}, @option{-gnato,} etc.)
+is passed to @command{gcc} (e.g.@: @option{-O}, @option{-gnato,} etc.)
 @end ifclear
 @ifset vms
 Any qualifier that cannot be recognized as a qualifier for @code{GNAT MAKE}
@@ -9065,7 +9214,7 @@ $ gnatmake /SOURCE_SEARCH=@i{[INCLUDE_DIR]}
 @item
 Using @command{gnatmake} along with the
 @option{^-m (minimal recompilation)^/MINIMAL_RECOMPILATION^}
-switch provides a mechanism for avoiding unnecessary rcompilations. Using
+switch provides a mechanism for avoiding unnecessary recompilations. Using
 this switch,
 you can update the comments/format of your
 source files without having to recompile everything. Note, however, that
@@ -9301,7 +9450,7 @@ exception handlers are used. The reason is that certain sections of code
 have to be marked as non-abortable.
 
 If you use neither the @code{abort} statement, nor asynchronous transfer
-of control (@code{select .. then abort}), then this distributed overhead
+of control (@code{select @dots{} then abort}), then this distributed overhead
 is removed, which may have a general positive effect in improving
 overall performance.  Especially code involving frequent use of tasking
 constructs and controlled types will show much improved performance.
@@ -9386,7 +9535,8 @@ and a time optimization on the same compile command.
 Since the precise set of optimizations done at each level will vary from
 release to release (and sometime from target to target), it is best to think
 of the optimization settings in general terms.
-The @cite{Using GNU GCC} manual contains details about
+@xref{Optimize Options,, Options That Control Optimization, gcc, Using
+the GNU Compiler Collection (GCC)}, for details about
 ^the @option{-O} settings and a number of @option{-f} options that^how to^
 individually enable or disable specific optimizations.
 
@@ -9599,13 +9749,13 @@ package R is
    pragma Inline (Q);
 end R;
 package body R is
-   ...
+   @dots{}
 end R;
 
 with R;
 procedure Main is
 begin
-   ...
+   @dots{}
    R.Q;
 end Main;
 @end cartouche
@@ -9655,15 +9805,16 @@ it actually improves performance.
 @subsection Other Optimization Switches
 @cindex Optimization Switches
 
-Since @code{GNAT} uses the @code{gcc} back end, all the specialized
-@code{gcc} optimization switches are potentially usable. These switches
+Since @code{GNAT} uses the @command{gcc} back end, all the specialized
+@command{gcc} optimization switches are potentially usable. These switches
 have not been extensively tested with GNAT but can generally be expected
 to work. Examples of switches in this category are
 @option{-funroll-loops} and
 the various target-specific @option{-m} options (in particular, it has been
 observed that @option{-march=pentium4} can significantly improve performance
-on appropriate machines). For full details of these switches, see the
-@code{gcc} manual.
+on appropriate machines). For full details of these switches, see
+@ref{Submodel Options,, Hardware Models and Configurations, gcc, Using
+the GNU Compiler Collection (GCC)}.
 
 @node Optimization and Strict Aliasing
 @subsection Optimization and Strict Aliasing
@@ -9686,16 +9837,16 @@ procedure R is
    type Int2A is access Int2;
    Int1V : Int1A;
    Int2V : Int2A;
-   ...
+   @dots{}
 
 begin
-   ...
+   @dots{}
    for J in Data'Range loop
       if Data (J) = Int1V.all then
          Int2V.all := Int2V.all + 1;
       end if;
    end loop;
-   ...
+   @dots{}
 end R;
 @end cartouche
 @end smallexample
@@ -9758,8 +9909,8 @@ end;
 @end smallexample
 
 @noindent
-This program prints out 0 in @code{-O0} or @code{-O1}
-mode, but it prints out 1 in @code{-O2} mode. That's
+This program prints out 0 in @option{-O0} or @option{-O1}
+mode, but it prints out 1 in @option{-O2} mode. That's
 because in strict aliasing mode, the compiler can and
 does assume that the assignment to @code{v2.all} could not
 affect the value of @code{v1.all}, since different types
@@ -9797,19 +9948,19 @@ the suspicious @code{Unchecked_Conversion}.
 As implied by the warning message, there are approaches you can use to
 avoid the unwanted strict aliasing optimization in a case like this.
 
-One possibility is to simply avoid the use of @code{-O2}, but
+One possibility is to simply avoid the use of @option{-O2}, but
 that is a bit drastic, since it throws away a number of useful
 optimizations that do not involve strict aliasing assumptions.
 
 A less drastic approach is to compile the program using the
-option @code{-fno-strict-aliasing}. Actually it is only the
+option @option{-fno-strict-aliasing}. Actually it is only the
 unit containing the dereferencing of the suspicious pointer
 that needs to be compiled. So in this case, if we compile
 unit @code{m} with this switch, then we get the expected
 value of zero printed. Analyzing which units might need
 the switch can be painful, so a more reasonable approach
-is to compile the entire program with options @code{-O2}
-and @code{-fno-strict-aliasing}. If the performance is
+is to compile the entire program with options @option{-O2}
+and @option{-fno-strict-aliasing}. If the performance is
 satisfactory with this combination of options, then the
 advantage is that the entire issue of possible "wrong"
 optimization due to strict aliasing is avoided.
@@ -9922,7 +10073,8 @@ subprograms that are declared but never called. By placing the list of
 @code{Eliminate} pragmas in the GNAT configuration file @file{gnat.adc} and
 recompiling your program, you may decrease the size of its executable,
 because the compiler will not generate the code for 'eliminated' subprograms.
-See GNAT Reference Manual for more information about this pragma.
+@xref{Pragma Eliminate,,, gnat_rm, GNAT Reference Manual}, for more
+information about this pragma.
 
 @code{gnatelim} needs as its input data the name of the main subprogram
 and a bind file for a main subprogram.
@@ -10135,8 +10287,9 @@ never used by this executable.
 This feature will allow you to eliminate such unused code from your
 executable, making it smaller (in disk and in memory).
 
-This functionality is available on all platforms using elf binary format and
-having GNU binutils version 2.16.1.
+This functionality is available on all Linux platforms except for the IA-64
+architecture and on all cross platforms using the ELF binary file format.
+In both cases GNU binutils version 2.16 or later are required to enable it.
 
 @node Compilation options
 @subsection Compilation options
@@ -10157,8 +10310,8 @@ function or data in a separate section in the resulting object file.
 Once the objects and static libraries are created with these options, the
 linker can perform the dead code elimination. You can do this by setting
 the @option{-Wl,--gc-sections} option to gcc command or in the
-@option{-largs} section of gnatmake. This will perform a garbage collection of
-code and data never referenced.
+@option{-largs} section of @command{gnatmake}. This will perform a
+garbage collection of code and data never referenced.
 
 If the linker performs a partial link (@option{-r} ld linker option), then you
 will need to provide one or several entry point using the
@@ -10344,7 +10497,7 @@ in which GNAT processes the ACVC tests.
 The @code{gnatchop} command has the form:
 
 @smallexample
-$ gnatchop switches @var{file name} [@var{file name} @var{file name} ...]
+$ gnatchop switches @var{file name} [@var{file name} @var{file name} @dots{}]
       [@var{directory}]
 @end smallexample
 
@@ -10433,6 +10586,15 @@ no source files written
 @table @option
 @c !sort!
 
+@item --version
+@cindex @option{--version} @command{gnatchop}
+Display Copyright and version, then exit disregarding all other options.
+
+@item --help
+@cindex @option{--help} @command{gnatchop}
+If @option{--version} was not used, display usage, then exit disregarding
+all other options.
+
 @item ^-c^/COMPILATION^
 @cindex @option{^-c^/COMPILATION^} (@code{gnatchop})
 Causes @code{gnatchop} to operate in compilation mode, in which
@@ -10440,9 +10602,9 @@ configuration pragmas are handled according to strict RM rules. See
 previous section for a full description of this mode.
 
 @ifclear vms
-@item -gnatxxx
-This passes the given @option{-gnatxxx} switch to @code{gnat} which is
-used to parse the given file. Not all @code{xxx} options make sense,
+@item -gnat@var{xxx}
+This passes the given @option{-gnat@var{xxx}} switch to @code{gnat} which is
+used to parse the given file. Not all @var{xxx} options make sense,
 but for example, the use of @option{-gnati2} allows @code{gnatchop} to
 process a source file that uses Latin-2 coding for identifiers.
 @end ifclear
@@ -10526,7 +10688,7 @@ check, and causes all but the last instance of such duplicated
 units to be skipped.
 
 @ifclear vms
-@item --GCC=xxxx
+@item --GCC=@var{xxxx}
 @cindex @option{--GCC=} (@code{gnatchop})
 Specify the path of the GNAT parser to be used. When this switch is used,
 no attempt is made to add the prefix to the GNAT parser executable.
@@ -10579,10 +10741,10 @@ unit will be skipped.
 @noindent
 Configuration pragmas include those pragmas described as
 such in the Ada Reference Manual, as well as
-implementation-dependent pragmas that are configuration pragmas. See the
-individual descriptions of pragmas in the @cite{GNAT Reference Manual} for
-details on these additional GNAT-specific configuration pragmas. Most
-notably, the pragma @code{Source_File_Name}, which allows
+implementation-dependent pragmas that are configuration pragmas.
+@xref{Implementation Defined Pragmas,,, gnat_rm, GNAT Reference Manual},
+for details on these additional GNAT-specific configuration pragmas.
+Most notably, the pragma @code{Source_File_Name}, which allows
 specifying non-default names for source files, is a configuration
 pragma. The following is a complete list of configuration pragmas
 recognized by GNAT:
@@ -10722,7 +10884,7 @@ When the source file names do not follow the standard GNAT default file naming
 conventions, the GNAT compiler must be given additional information through
 a configuration pragmas file (@pxref{Configuration Pragmas})
 or a project file.
-When the non standard file naming conventions are well-defined,
+When the non-standard file naming conventions are well-defined,
 a small number of pragmas @code{Source_File_Name} specifying a naming pattern
 (@pxref{Alternative File Naming Schemes}) may be sufficient. However,
 if the file naming conventions are irregular or arbitrary, a number
@@ -10791,6 +10953,15 @@ You may specify any of the following switches to @code{gnatname}:
 @table @option
 @c !sort!
 
+@item --version
+@cindex @option{--version} @command{gnatname}
+Display Copyright and version, then exit disregarding all other options.
+
+@item --help
+@cindex @option{--help} @command{gnatname}
+If @option{--version} was not used, display usage, then exit disregarding
+all other options.
+
 @item ^-c^/CONFIG_FILE=^@file{file}
 @cindex @option{^-c^/CONFIG_FILE^} (@code{gnatname})
 Create a configuration pragmas file @file{file} (instead of the default
@@ -10829,9 +11000,9 @@ Look for source files in all directories listed in text file @file{file}.
 There may be zero, one or more spaces between @option{^-D^/DIRS_FILE=^}
 and @file{file}.
 @file{file} must be an existing, readable text file.
-Each non empty line in @file{file} must be a directory.
+Each nonempty line in @file{file} must be a directory.
 Specifying switch @option{^-D^/DIRS_FILE^} is equivalent to specifying as many
-switches @option{^-d^/SOURCE_DIRS^} as there are non empty lines in
+switches @option{^-d^/SOURCE_DIRS^} as there are nonempty lines in
 @file{file}.
 
 @item ^-f^/FOREIGN_PATTERN=^@file{pattern}
@@ -10846,7 +11017,7 @@ gnatname ^-Pprj -f"*.c"^/PROJECT_FILE=PRJ /FOREIGN_PATTERN=*.C^ "*.ada"
 @noindent
 will look for Ada units in all files with the @file{.ada} extension,
 and will add to the list of file for project @file{prj.gpr} the C files
-with extension ".^c^C^".
+with extension @file{.^c^C^}.
 
 @item ^-h^/HELP^
 @cindex @option{^-h^/HELP^} (@code{gnatname})
@@ -11081,7 +11252,8 @@ that might be used by the developers.
 The next section introduces the main features of GNAT's project facility
 through a sequence of examples; subsequent sections will present the syntax
 and semantics in more detail. A more formal description of the project
-facility appears in the GNAT Reference Manual.
+facility appears in @ref{Project File Reference,,, gnat_rm, GNAT
+Reference Manual}.
 
 @c *****************************
 @c * Examples of Project Files *
@@ -11351,7 +11523,7 @@ Attribute @code{Executable_Suffix}, when specified, may change the suffix
 of the executable files, when no attribute @code{Executable} applies:
 its value replace the platform-specific executable suffix.
 Attributes @code{Executable} and @code{Executable_Suffix} are the only ways to
-specify a non default executable file name when several mains are built at once
+specify a non-default executable file name when several mains are built at once
 in a single @command{gnatmake} command.
 
 @node Source File Naming Conventions
@@ -11537,7 +11709,7 @@ files is located in its respective project file directory.  Schematically:
 @noindent
 We want to develop an application in directory @file{^/app^[APP]^} that
 @code{with} the packages @code{GUI} and @code{Comm}, using the properties of
-the corresponding project files (e.g. the ^switch^switch^ settings
+the corresponding project files (e.g.@: the ^switch^switch^ settings
 and object directory).
 Skeletal code for a main procedure might be something like the following:
 
@@ -11545,9 +11717,9 @@ Skeletal code for a main procedure might be something like the following:
 @group
 with GUI, Comm;
 procedure App_Main is
-   ...
+   @dots{}
 begin
-   ...
+   @dots{}
 end App_Main;
 @end group
 @end smallexample
@@ -11701,20 +11873,20 @@ and no longer requires a body: in this case, it is necessary to indicate that
 the inherited body is not part of the sources of the project, otherwise there
 will be a compilation error when compiling the spec.
 
-For that purpose, the attribute @code{Locally_Removed_Files} is used.
+For that purpose, the attribute @code{Excluded_Source_Files} is used.
 Its value is a string list: a list of file names.
 
 @smallexample @c @projectfile
 project B extends "a" is
    for Source_Files use ("pkg.ads");
    --  New spec of Pkg does not need a completion
-   for Locally_Removed_Files use ("pkg.adb");
+   for Excluded_Source_Files use ("pkg.adb");
 end B;
 @end smallexample
 
-Attribute @code{Locally_Removed_Files} may also be used to check if a source
+Attribute @code{Excluded_Source_Files} may also be used to check if a source
 is still needed: if it is possible to build using @command{gnatmake} when such
-a source is put in attribute @code{Locally_Removed_Files} of a project P, then
+a source is put in attribute @code{Excluded_Source_Files} of a project P, then
 it is possible to remove the source completely from a system that includes
 project P.
 
@@ -11814,7 +11986,7 @@ reserved words currently used in project file syntax are:
 @end itemize
 
 @noindent
-Comments in project files have the same syntax as in Ada, two consecutives
+Comments in project files have the same syntax as in Ada, two consecutive
 hyphens through the end of the line.
 
 @node Packages
@@ -11891,7 +12063,7 @@ A @emph{string expression} is either a @emph{simple string expression} or a
 
 A @emph{simple string expression} is one of the following:
 @itemize @bullet
-@item A literal string; e.g.@code{"comm/my_proj.gpr"}
+@item A literal string; e.g.@: @code{"comm/my_proj.gpr"}
 @item A string-valued variable reference (@pxref{Variables})
 @item A string-valued attribute reference (@pxref{Attributes})
 @item An external reference (@pxref{External References in Project Files})
@@ -12079,7 +12251,9 @@ The following attributes are defined on projects (all are simple attributes):
 @tab string
 @item @code{Exec_Dir}
 @tab string
-@item @code{Locally_Removed_Files}
+@item @code{Excluded_Source_Dirs}
+@tab string list
+@item @code{Excluded_Source_Files}
 @tab string list
 @item @code{Languages}
 @tab string list
@@ -12387,7 +12561,7 @@ in the project file.
 @end smallexample
 
 @noindent
-The attribute @var{Object_Dir} has a string value, the path name of the object
+The attribute @code{Object_Dir} has a string value, the path name of the object
 directory. The path name may be absolute or relative to the directory of the
 project file. This directory must already exist, and be readable and writable.
 
@@ -12410,7 +12584,7 @@ in the project file.
 @end smallexample
 
 @noindent
-The attribute @var{Exec_Dir} has a string value, the path name of the exec
+The attribute @code{Exec_Dir} has a string value, the path name of the exec
 directory. The path name may be absolute or relative to the directory of the
 project file. This directory must already exist, and be writable.
 
@@ -12557,7 +12731,7 @@ source files.
   with "project1", "utilities.gpr";
   with "/namings/apex.gpr";
   project Main is
-    ...
+    @dots{}
 @end group
 @end smallexample
 
@@ -12684,7 +12858,7 @@ modified versions of some of the source files, without changing the original
 sources. This can be achieved through the @emph{project extension} facility.
 
 @smallexample @c projectfile
-   project Modified_Utilities extends "/baseline/utilities.gpr" is ...
+   project Modified_Utilities extends "/baseline/utilities.gpr" is @dots{}
 @end smallexample
 
 @noindent
@@ -12763,7 +12937,7 @@ This project hierarchy will need to be extended as follows:
 Create project A1 that extends A, placing modified P1 there:
 
 @smallexample @c 0projectfile
-project A1 extends "(...)/A" is
+project A1 extends "(@dots{})/A" is
 end A1;
 @end smallexample
 
@@ -12772,8 +12946,8 @@ Create project C1 that "extends all" C and imports A1, placing modified
 P3 there:
 
 @smallexample @c 0projectfile
-with "(...)/A1";
-project C1 extends all "(...)/C" is
+with "(@dots{})/A1";
+project C1 extends all "(@dots{})/C" is
 end C1;
 @end smallexample
 @end enumerate
@@ -12838,7 +13012,7 @@ an attribute declaration.
    Mode : Mode_Type := external ("MODE");
    case Mode is
      when "Debug" =>
-        ...
+        @dots{}
 @end group
 @end smallexample
 
@@ -12898,7 +13072,7 @@ the project file for an imported project.
   with "/global/apex.gpr";
   project Example is
     package Naming renames Apex.Naming;
-    ...
+    @dots{}
   end Example;
 @end group
 @end smallexample
@@ -13038,14 +13212,14 @@ You can define the following attributes in package @code{Naming}:
 
 @table @code
 
-@item @var{Casing}
+@item @code{Casing}
 This must be a string with one of the three values @code{"lowercase"},
 @code{"uppercase"} or @code{"mixedcase"}; these strings are case insensitive.
 
 @noindent
-If @var{Casing} is not specified, then the default is @code{"lowercase"}.
+If @code{Casing} is not specified, then the default is @code{"lowercase"}.
 
-@item @var{Dot_Replacement}
+@item @code{Dot_Replacement}
 This must be a string whose value satisfies the following conditions:
 
 @itemize @bullet
@@ -13060,7 +13234,7 @@ is @code{"."}
 @noindent
 If @code{Dot_Replacement} is not specified, then the default is @code{"-"}.
 
-@item @var{Spec_Suffix}
+@item @code{Spec_Suffix}
 This is an associative array (indexed by the programming language name, case
 insensitive) whose value is a string that must satisfy the following
 conditions:
@@ -13073,7 +13247,7 @@ conditions:
 If @code{Spec_Suffix ("Ada")} is not specified, then the default is
 @code{"^.ads^.ADS^"}.
 
-@item @var{Body_Suffix}
+@item @code{Body_Suffix}
 This is an associative array (indexed by the programming language name, case
 insensitive) whose value is a string that must satisfy the following
 conditions:
@@ -13081,21 +13255,26 @@ conditions:
 @itemize @bullet
 @item It must not be empty
 @item It must include at least one dot
-@item It cannot end with the same string as @code{Spec_Suffix ("Ada")}
+@item It cannot be the same as @code{Spec_Suffix ("Ada")}
 @end itemize
 @noindent
+If @code{Body_Suffix ("Ada")} and @code{Spec_Suffix ("Ada")} end with the
+same string, then a file name that ends with the longest of these two suffixes
+will be a body if the longest suffix is @code{Body_Suffix ("Ada")} or a spec
+if the longest suffix is @code{Spec_Suffix ("Ada")}.
+
 If @code{Body_Suffix ("Ada")} is not specified, then the default is
 @code{"^.adb^.ADB^"}.
 
-@item @var{Separate_Suffix}
+@item @code{Separate_Suffix}
 This must be a string whose value satisfies the same conditions as
-@code{Body_Suffix}.
+@code{Body_Suffix}. The same "longest suffix" rules apply.
 
 @noindent
 If @code{Separate_Suffix ("Ada")} is not specified, then it defaults to same
 value as @code{Body_Suffix ("Ada")}.
 
-@item @var{Spec}
+@item @code{Spec}
 @noindent
 You can use the associative array attribute @code{Spec}  to define
 the source file name for an individual Ada compilation unit's spec. The array
@@ -13108,7 +13287,7 @@ operating system).
    for Spec ("MyPack.MyChild") use "mypack.mychild.spec";
 @end smallexample
 
-@item @var{Body}
+@item @code{Body}
 
 You can use the associative array attribute @code{Body} to
 define the source file name for an individual Ada compilation unit's body
@@ -13278,7 +13457,7 @@ that make a project a Library Project (@code{Library_Name} and
 @end group
 @end smallexample
 
-Attribute @code{Library_Interface} has a non empty string list value,
+Attribute @code{Library_Interface} has a nonempty string list value,
 each string in the list designating a unit contained in an immediate source
 of the project file.
 
@@ -13301,7 +13480,7 @@ two possible values: "false" or "true" (case-insensitive). Specifying
 "false" for attribute @code{Library_Auto_Init} will prevent automatic
 initialization of dynamic or relocatable libraries.
 
-When a non automatically initialized Stand-alone Library is used
+When a non-automatically initialized Stand-alone Library is used
 in an executable, its initialization procedure must be called before
 any service of the library is used.
 When the main subprogram is in Ada, it may mean that the initialization
@@ -13663,7 +13842,7 @@ end Proj4;
 -- Ada source file:
 with Pack;
 procedure Foo_Main is
-   ...
+   @dots{}
 end Foo_Main;
 @end group
 @end smallexample
@@ -13892,7 +14071,7 @@ XREF to invoke @command{^gnatxref^gnatxref^}
 @command{^gnatmake -f -u -c^gnatmake -f -u -c^}).
 
 @noindent
-On non VMS platforms, between @command{gnat} and the command, two
+On non-VMS platforms, between @command{gnat} and the command, two
 special switches may be used:
 
 @itemize @bullet
@@ -14116,7 +14295,7 @@ It is also possible to invoke some of the tools,
 @code{^gnatmetric^gnatmetric^}),
 and @code{^gnatpp^gnatpp^})
 on a set of project units thanks to the combination of the switches
-@code{-P}, @code{-U} and possibly the main unit when one is interested
+@option{-P}, @option{-U} and possibly the main unit when one is interested
 in its closure. For instance,
 @smallexample
 gnat metric -Pproj
@@ -14460,7 +14639,7 @@ use the @code{gnat} driver (see @ref{The GNAT Driver and Project Files}).
 @noindent
 The command invocation for @code{gnatxref} is:
 @smallexample
-$ gnatxref [switches] sourcefile1 [sourcefile2 ...]
+$ gnatxref [switches] sourcefile1 [sourcefile2 @dots{}]
 @end smallexample
 
 @noindent
@@ -14483,9 +14662,18 @@ the source path. If you specify directories, no result is produced.
 @end table
 
 @noindent
-The switches can be :
+The switches can be:
 @table @option
 @c !sort!
+@item --version
+@cindex @option{--version} @command{gnatxref}
+Display Copyright and version, then exit disregarding all other options.
+
+@item --help
+@cindex @option{--help} @command{gnatxref}
+If @option{--version} was not used, display usage, then exit disregarding
+all other options.
+
 @item ^-a^/ALL_FILES^
 @cindex @option{^-a^/ALL_FILES^} (@command{gnatxref})
 If this switch is present, @code{gnatfind} and @code{gnatxref} will parse
@@ -14583,7 +14771,7 @@ The command line for @code{gnatfind} is:
 
 @smallexample
 $ gnatfind [switches] pattern[:sourcefile[:line[:column]]]
-      [file1 file2 ...]
+      [file1 file2 @dots{}]
 @end smallexample
 
 @noindent
@@ -14617,21 +14805,23 @@ is a decimal integer identifying the exact location on the
 line of the first character of the identifier for the
 entity reference. Columns are numbered from 1.
 
-@item file1 file2 ...
+@item file1 file2 @dots{}
 The search will be restricted to these source files. If none are given, then
 the search will be done for every library file in the search path.
 These file must appear only after the pattern or sourcefile.
 
 These file names are considered to be regular expressions, so for instance
-specifying 'source*.adb' is the same as giving every file in the current
-directory whose name starts with 'source' and whose extension is 'adb'.
+specifying @file{source*.adb} is the same as giving every file in the current
+directory whose name starts with @file{source} and whose extension is
+@file{adb}.
 
 The location of the spec of the entity will always be displayed, even if it
-isn't in one of file1, file2,... The occurrences of the entity in the
-separate units of the ones given on the command line will also be displayed.
+isn't in one of @file{file1}, @file{file2},@enddots{}  The occurrences
+of the entity in the separate units of the ones given on the command
+line will also be displayed.
 
 Note that if you specify at least one file in this part, @code{gnatfind} may
-sometimes not be able to find the body of the subprograms...
+sometimes not be able to find the body of the subprograms.
 
 @end table
 
@@ -14643,6 +14833,14 @@ The following switches are available:
 @table @option
 @c !sort!
 
+@cindex @option{--version} @command{gnatfind}
+Display Copyright and version, then exit disregarding all other options.
+
+@item --help
+@cindex @option{--help} @command{gnatfind}
+If @option{--version} was not used, display usage, then exit disregarding
+all other options.
+
 @item ^-a^/ALL_FILES^
 @cindex @option{^-a^/ALL_FILES^} (@command{gnatfind})
 If this switch is present, @code{gnatfind} and @code{gnatxref} will parse
@@ -14852,14 +15050,14 @@ specifies the command used to debug the application
 @noindent
 As specified in the section about @command{gnatfind}, the pattern can be a
 regular expression. Actually, there are to set of regular expressions
-which are recognized by the program :
+which are recognized by the program:
 
 @table @code
 @item globbing patterns
 These are the most usual regular expression. They are the same that you
 generally used in a Unix shell command line, or in a DOS session.
 
-Here is a more formal grammar :
+Here is a more formal grammar:
 @smallexample
 @group
 @iftex
@@ -14870,7 +15068,7 @@ term   ::= elmt            -- matches elmt
 term   ::= elmt elmt       -- concatenation (elmt then elmt)
 term   ::= *               -- any string of 0 or more characters
 term   ::= ?               -- matches any character
-term   ::= [char @{char@}] -- matches any character listed
+term   ::= [char @{char@}]   -- matches any character listed
 term   ::= [char - char]   -- matches any character in range
 @end group
 @end smallexample
@@ -14887,9 +15085,9 @@ reference manual style BNF is as follows
 @leftskip=.5cm
 @end iftex
 @group
-regexp ::= term @{| term@} -- alternation (term or term ...)
+regexp ::= term @{| term@}   -- alternation (term or term @dots{})
 
-term ::= item @{item@}     -- concatenation (item then item)
+term ::= item @{item@}       -- concatenation (item then item)
 
 item ::= elmt              -- match elmt
 item ::= elmt *            -- zero or more elmt's
@@ -14910,18 +15108,19 @@ nschar ::= any character except ()[].*+?^^^
 @end group
 @end smallexample
 
-Following are a few examples :
+Following are a few examples:
 
 @table @samp
 @item abcde|fghi
-will match any of the two strings 'abcde' and 'fghi'.
+will match any of the two strings @samp{abcde} and @samp{fghi},
 
 @item abc*d
-will match any string like 'abd', 'abcd', 'abccd', 'abcccd', and so on
+will match any string like @samp{abd}, @samp{abcd}, @samp{abccd},
+@samp{abcccd}, and so on,
 
 @item [a-z]+
 will match any string which has only lowercase characters in it (and at
-least one character
+least one character.
 
 @end table
 @end table
@@ -14932,7 +15131,7 @@ least one character
 @subsection General Usage
 
 @noindent
-For the following examples, we will consider the following units :
+For the following examples, we will consider the following units:
 
 @smallexample @c ada
 @group
@@ -15028,9 +15227,9 @@ of these.
 @subsection Using gnatxref with vi
 
 @code{gnatxref} can generate a tags file output, which can be used
-directly from @file{vi}. Note that the standard version of @file{vi}
+directly from @command{vi}. Note that the standard version of @command{vi}
 will not work properly with overloaded symbols. Consider using another
-free implementation of @file{vi}, such as @file{vim}.
+free implementation of @command{vi}, such as @command{vim}.
 
 @smallexample
 $ gnatxref -v gnatfind.adb > tags
@@ -15040,7 +15239,7 @@ $ gnatxref -v gnatfind.adb > tags
 will generate the tags file for @code{gnatfind} itself (if the sources
 are in the search path!).
 
-From @file{vi}, you can then use the command @samp{:tag @i{entity}}
+From @command{vi}, you can then use the command @samp{:tag @i{entity}}
 (replacing @i{entity} by whatever you are looking for), and vi will
 display a new file with the corresponding declaration of entity.
 @end ifclear
@@ -15423,7 +15622,22 @@ case if the specification occupies more then one line.
 @cindex @option{^--separate-loop-then^/SEPARATE_LOOP_THEN^} (@command{gnatpp})
 @item ^--separate-loop-then^/SEPARATE_LOOP_THEN^
 Place the keyword @code{loop} in FOR and WHILE loop statements and the
-keywird @code{then} in IF statements on a separate line.
+keyword @code{then} in IF statements on a separate line.
+
+@cindex @option{^--no-separate-loop-then^/NO_SEPARATE_LOOP_THEN^} (@command{gnatpp})
+@item ^--no-separate-loop-then^/NO_SEPARATE_LOOP_THEN^
+Do not place the keyword @code{loop} in FOR and WHILE loop statements and the
+keyword @code{then} in IF statements on a separate line. This option is
+incompatible with @option{^--separate-loop-then^/SEPARATE_LOOP_THEN^} option.
+
+@cindex @option{^--use-on-new-line^/USE_ON_NEW_LINE^} (@command{gnatpp})
+@item ^--use-on-new-line^/USE_ON_NEW_LINE^
+Start each USE clause in a context clause from a separate line.
+
+@cindex @option{^--separate-stmt-name^/STMT_NAME_ON_NEW_LINE^} (@command{gnatpp})
+@item ^--separate-stmt-name^/STMT_NAME_ON_NEW_LINE^
+Use a separate line for a loop or block statement name, but do not use an extra
+indentation level for the statement itself.
 
 @end table
 
@@ -15462,16 +15676,16 @@ These switches allow control over line length and indentation.
 @table @option
 @item ^-M@i{nnn}^/LINE_LENGTH_MAX=@i{nnn}^
 @cindex @option{^-M^/LINE_LENGTH^} (@command{gnatpp})
-Maximum line length, @i{nnn} from 32 ..256, the default value is 79
+Maximum line length, @i{nnn} from 32@dots{}256, the default value is 79
 
 @item ^-i@i{nnn}^/INDENTATION_LEVEL=@i{nnn}^
 @cindex @option{^-i^/INDENTATION_LEVEL^} (@command{gnatpp})
-Indentation level, @i{nnn} from 1 .. 9, the default value is 3
+Indentation level, @i{nnn} from 1@dots{}9, the default value is 3
 
 @item ^-cl@i{nnn}^/CONTINUATION_INDENT=@i{nnn}^
 @cindex @option{^-cl^/CONTINUATION_INDENT^} (@command{gnatpp})
 Indentation level for continuation lines (relative to the line being
-continued), @i{nnn} from 1 .. 9.
+continued), @i{nnn} from 1@dots{}9.
 The default
 value is one less then the (normal) indentation level, unless the
 indentation is set to 1 (in which case the default value for continuation
@@ -15859,10 +16073,10 @@ many words in a line as possible).
 @noindent
 The @option{^-c5^/COMMENTS_LAYOUT=KEEP_SPECIAL^} switch specifies, that comments
 that has a special format (that is, a character that is neither a letter nor digit
-not white space nor line break immediatelly following the leading @code{--} of
+not white space nor line break immediately following the leading @code{--} of
 the comment) should be without any change moved from the argument source
 into reformatted source. This switch allows to preserve comments that are used
-as a special marks in the code (e.g. SPARK annotation).
+as a special marks in the code (e.g.@: SPARK annotation).
 
 @node Construct Layout
 @subsection Construct Layout
@@ -16008,6 +16222,13 @@ A further difference between GNAT style layout and compact layout is that
 GNAT style layout inserts empty lines as separation for
 compound statements, return statements and bodies.
 
+Note that the layout specified by
+@option{^--separate-stmt-name^/STMT_NAME_ON_NEW_LINE^}
+for named block and loop statements overrides the layout defined by these
+constructs by @option{^-l1^/CONSTRUCT_LAYOUT=GNAT^},
+@option{^-l2^/CONSTRUCT_LAYOUT=COMPACT^} or
+@option{^-l3^/CONSTRUCT_LAYOUT=UNCOMPACT^} option.
+
 @node Name Casing
 @subsection Name Casing
 
@@ -16268,9 +16489,7 @@ The following subsections describe the various switches accepted by
 @menu
 * Output Files Control::
 * Disable Metrics For Local Units::
-* Line Metrics Control::
-* Syntax Metrics Control::
-* Complexity Metrics Control::
+* Specifying a set of metrics to compute::
 * Other gnatmetric Switches::
 * Generate project-wide metrics::
 @end menu
@@ -16286,9 +16505,11 @@ output is generated.
 
 When generating the output in textual form, @command{gnatmetric} creates
 for each Ada source file a corresponding text file
-containing the computed metrics. By default, this file
-is placed in the same directory as where the source file is located, and
-its name is obtained
+containing the computed metrics, except for the case when the set of metrics
+specified by gnatmetric parameters consists only of metrics that are computed
+for the whole set of analyzed sources, but not for each Ada source.
+By default, this file is placed in the same directory as where the source
+file is located, and its name is obtained
 by appending the ^@file{.metrix}^@file{$METRIX}^ suffix to the name of the
 input file.
 
@@ -16388,8 +16609,26 @@ Do not compute detailed metrics for eligible local program units
 
 @end table
 
+@node Specifying a set of metrics to compute
+@subsection Specifying a set of metrics to compute
+
+@noindent
+By default all the metrics are computed and reported. The switches
+described in this subsection allow you to control, on an individual
+basis, whether metrics are computed and
+reported. If at least one positive metric
+switch is specified (that is, a switch that defines that a given
+metric or set of metrics is to be computed), then only
+explicitly specified metrics are reported.
+
+@menu
+* Line Metrics Control::
+* Syntax Metrics Control::
+* Complexity Metrics Control::
+@end menu
+
 @node Line Metrics Control
-@subsection Line Metrics Control
+@subsubsection Line Metrics Control
 @cindex Line metrics control in @command{gnatmetric}
 
 @noindent
@@ -16411,46 +16650,93 @@ the number of comment lines
 the number of code lines containing end-of-line comments;
 
 @item
+the comment percentage: the ratio between the number of lines that contain
+comments and the number of all non-blank lines, expressed as a percentage;
+
+@item
 the number of empty lines and lines containing only space characters and/or
 format effectors (blank lines)
 
+@item
+the average number of code lines in subprogram bodies, task bodies, entry
+bodies and statement sequences in package bodies (this metric is only computed
+across the whole set of the analyzed units)
+
 @end itemize
 
-If @command{gnatmetric} is invoked on more than one source file, it sums the
-values of the line metrics for all the files being processed and then
-generates the cumulative results.
+@noindent
+@command{gnatmetric} sums the values of the line metrics for all the
+files being processed and then generates the cumulative results. The tool
+also computes for all the files being processed the average number of code
+lines in bodies.
 
-By default, all the line metrics are computed and reported. You can use the
-following switches to select the specific line metrics to be computed and
-reported (if any of these parameters is set, only explicitly specified line
-metrics are computed).
+You can use the following switches to select the specific line metrics
+to be computed and reported.
 
 @table @option
-@cindex @option{^-la^/LINES_ALL^} (@command{gnatmetric})
-@item ^-la^/LINES_ALL^
-The number of all lines
+@cindex @option{^--lines@var{x}^/LINE_COUNT_METRICS^} (@command{gnatmetric})
+
+@ifclear vms
+@cindex @option{--no-lines@var{x}}
+@end ifclear
+
+@item ^--lines-all^/LINE_COUNT_METRICS=ALL_ON^
+Report all the line metrics
+
+@item ^--no-lines-all^/LINE_COUNT_METRICS=ALL_OFF^
+Do not report any of line metrics
+
+@item ^--lines^/LINE_COUNT_METRICS=ALL_LINES_ON^
+Report the number of all lines
 
-@cindex @option{^-lcode^/CODE_LINES^} (@command{gnatmetric})
-@item ^-lcode^/CODE_LINES^
-The number of code lines
+@item ^--no-lines^/LINE_COUNT_METRICS=ALL_LINES_OFF^
+Do not report the number of all lines
 
-@cindex @option{^-lcomm^/COMMENT_LINES^} (@command{gnatmetric})
-@item ^-lcomm^/COMENT_LINES^
-The number of comment lines
+@item ^--lines-code^/LINE_COUNT_METRICS=CODE_LINES_ON^
+Report the number of code lines
 
-@cindex @option{^-leol^/MIXED_CODE_COMMENTS^} (@command{gnatmetric})
-@item ^-leol^/MIXED_CODE_COMMENTS^
-The number of code lines containing
+@item ^--no-lines-code^/LINE_COUNT_METRICS=CODE_LINES_OFF^
+Do not report the number of code lines
+
+@item ^--lines-comment^/LINE_COUNT_METRICS=COMMENT_LINES_ON^
+Report the number of comment lines
+
+@item ^--no-lines-comment^/LINE_COUNT_METRICS=COMMENT_LINES_OFF^
+Do not report the number of comment lines
+
+@item ^--lines-eol-comment^/LINE_COUNT_METRICS=CODE_COMMENT_LINES_ON^
+Report the number of code lines containing
+end-of-line comments
+
+@item ^--no-lines-eol-comment^/LINE_COUNT_METRICS=CODE_COMMENT_LINES_OFF^
+Do not report the number of code lines containing
 end-of-line comments
 
-@cindex @option{^-lb^/BLANK_LINES^} (@command{gnatmetric})
-@item ^-lb^/BLANK_LINES^
-The number of blank lines
+@item ^--lines-ratio^/LINE_COUNT_METRICS=COMMENT_PERCENTAGE_ON^
+Report the comment percentage in the program text
+
+@item ^--no-lines-ratio^/LINE_COUNT_METRICS=COMMENT_PERCENTAGE_OFF^
+Do not report the comment percentage in the program text
+
+@item ^--lines-blank^/LINE_COUNT_METRICS=BLANK_LINES_ON^
+Report the number of blank lines
+
+@item ^--no-lines-blank^/LINE_COUNT_METRICS=BLANK_LINES_OFF^
+Do not report the number of blank lines
+
+@item ^--lines-average^/LINE_COUNT_METRICS=AVERAGE_BODY_LINES_ON^
+Report the average number of code lines in subprogram bodies, task bodies,
+entry bodies and statement sequences in package bodies. The metric is computed
+and reported for the whole set of processed Ada sources only.
+
+@item ^--no-lines-average^/LINE_COUNT_METRICS=AVERAGE_BODY_LINES_OFF^
+Do not report the average number of code lines in subprogram bodies,
+task bodies, entry bodies and statement sequences in package bodies.
 
 @end table
 
 @node Syntax Metrics Control
-@subsection Syntax Metrics Control
+@subsubsection Syntax Metrics Control
 @cindex Syntax metrics control in @command{gnatmetric}
 
 @noindent
@@ -16482,7 +16768,7 @@ the following metrics:
 @item Public subprograms
 This metric is computed for package specifications. It is the
 number of subprograms and generic subprograms declared in the visible
-part (including in nested packages, protected objects, and
+part (including the visible part of nested packages, protected objects, and
 protected types).
 
 @item All subprograms
@@ -16498,8 +16784,8 @@ subprograms are counted in the same way as ``usual'' subprogram bodies.
 This metric is computed for package specifications and
 generic package declarations. It is the total number of types
 that can be referenced from outside this compilation unit, plus the
-number of types from all the visible parts of all the visible generic packages.
-Generic formal types are not counted.  Only types, not subtypes,
+number of types from all the visible parts of all the visible generic
+packages. Generic formal types are not counted.  Only types, not subtypes,
 are included.
 
 @noindent
@@ -16538,52 +16824,80 @@ private etc.); the total number of types is computed and reported.
 
 @noindent
 By default, all the syntax metrics are computed and reported. You can use the
-following switches to select specific syntax metrics;
-if any of these is set, only the explicitly specified metrics are computed.
+following switches to select specific syntax metrics.
 
 @table @option
-@cindex @option{^-ed^/DECLARATION_TOTAL^} (@command{gnatmetric})
-@item ^-ed^/DECLARATION_TOTAL^
-The total number of declarations
 
-@cindex @option{^-es^/STATEMENT_TOTAL^} (@command{gnatmetric})
-@item ^-es^/STATEMENT_TOTAL^
-The total number of statements
+@cindex @option{^--syntax@var{x}^/SYNTAX_METRICS^} (@command{gnatmetric})
+
+@ifclear vms
+@cindex @option{--no-syntax@var{x}}
+@end ifclear
+
+@item ^--syntax-all^/SYNTAX_METRICS=ALL_ON^
+Report all the syntax metrics
+
+@item ^--no-syntax-all^/ALL_OFF^
+Do not report any of syntax metrics
+
+@item ^--declarations^/SYNTAX_METRICS=DECLARATIONS_ON^
+Report the total number of declarations
+
+@item ^--no-declarations^/SYNTAX_METRICS=DECLARATIONS_OFF^
+Do not report the total number of declarations
+
+@item ^--statements^/SYNTAX_METRICS=STATEMENTS_ON^
+Report the total number of statements
+
+@item ^--no-statements^/SYNTAX_METRICS=STATEMENTS_OFF^
+Do not report the total number of statements
+
+@item ^--public-subprograms^/SYNTAX_METRICS=PUBLIC_SUBPROGRAMS_ON^
+Report the number of public subprograms in a compilation unit
+
+@item ^--no-public-subprograms^/SYNTAX_METRICS=PUBLIC_SUBPROGRAMS_OFF^
+Do not report the number of public subprograms in a compilation unit
+
+@item ^--all-subprograms^/SYNTAX_METRICS=ALL_SUBPROGRAMS_ON^
+Report the number of all the subprograms in a compilation unit
+
+@item ^--no-all-subprograms^/SYNTAX_METRICS=ALL_SUBPROGRAMS_OFF^
+Do not report the number of all the subprograms in a compilation unit
+
+@item ^--public-types^/SYNTAX_METRICS=PUBLIC_TYPES_ON^
+Report the number of public types in a compilation unit
+
+@item ^--no-public-types^/SYNTAX_METRICS=PUBLIC_TYPES_OFF^
+Do not report the number of public types in a compilation unit
 
-@cindex @option{^-eps^/^} (@command{gnatmetric})
-@item ^-eps^/INT_SUBPROGRAMS^
-The number of public subprograms in a compilation unit
+@item ^--all-types^/SYNTAX_METRICS=ALL_TYPES_ON^
+Report the number of all the types in a compilation unit
 
-@cindex @option{^-eas^/SUBPROGRAMS_ALL^} (@command{gnatmetric})
-@item ^-eas^/SUBPROGRAMS_ALL^
-The number of all the subprograms in a compilation unit
+@item ^--no-all-types^/SYNTAX_METRICS=ALL_TYPES_OFF^
+Do not report the number of all the types in a compilation unit
 
-@cindex @option{^-ept^/INT_TYPES^} (@command{gnatmetric})
-@item ^-ept^/INT_TYPES^
-The number of public types in a compilation unit
+@item ^--unit-nesting^/SYNTAX_METRICS=UNIT_NESTING_ON^
+Report the maximal program unit nesting level
 
-@cindex @option{^-eat^/TYPES_ALL^} (@command{gnatmetric})
-@item ^-eat^/TYPES_ALL^
-The number of all the types in a compilation unit
+@item ^--no-unit-nesting^/SYNTAX_METRICS=UNIT_NESTING_OFF^
+Do not report the maximal program unit nesting level
 
-@cindex @option{^-enu^/PROGRAM_NESTING_MAX^} (@command{gnatmetric})
-@item ^-enu^/PROGRAM_NESTING_MAX^
-The maximal program unit nesting level
+@item ^--construct-nesting^/SYNTAX_METRICS=CONSTRUCT_NESTING_ON^
+Report the maximal construct nesting level
 
-@cindex @option{^-ec^/CONSTRUCT_NESTING_MAX^} (@command{gnatmetric})
-@item ^-ec^/CONSTRUCT_NESTING_MAX^
-The maximal construct nesting level
+@item ^--no-construct-nesting^/SYNTAX_METRICS=CONSTRUCT_NESTING_OFF^
+Do not report the maximal construct nesting level
 
 @end table
 
 @node Complexity Metrics Control
-@subsection Complexity Metrics Control
+@subsubsection Complexity Metrics Control
 @cindex Complexity metrics control in @command{gnatmetric}
 
 @noindent
 For a program unit that is an executable body (a subprogram body (including
 generic bodies), task body, entry body or a package body containing
-its own statement sequence ) @command{gnatmetric} computes the following
+its own statement sequence) @command{gnatmetric} computes the following
 complexity metrics:
 
 @itemize @bullet
@@ -16624,22 +16938,52 @@ When computing cyclomatic and essential complexity, @command{gnatmetric} skips
 the code in the exception handlers and in all the nested program units.
 
 By default, all the complexity metrics are computed and reported.
-For more finely-grained control you can use
+For more fine-grained control you can use
 the following switches:
 
 @table @option
-@cindex @option{^-n@var{x}^/SUPPRESS^} (@command{gnatmetric})
+@cindex @option{^-complexity@var{x}^/COMPLEXITY_METRICS^} (@command{gnatmetric})
+
+@ifclear vms
+@cindex @option{--no-complexity@var{x}}
+@end ifclear
+
+@item ^--complexity-all^/COMPLEXITY_METRICS=ALL_ON^
+Report all the complexity metrics
+
+@item ^--no-complexity-all^/COMPLEXITY_METRICS=ALL_OFF^
+Do not report any of complexity metrics
+
+@item ^--complexity-cyclomatic^/COMPLEXITY_METRICS=CYCLOMATIC_ON^
+Report the McCabe Cyclomatic Complexity
+
+@item ^--no-complexity-cyclomatic^/COMPLEXITY_METRICS=CYCLOMATIC_OFF^
+Do not report the McCabe Cyclomatic Complexity
 
-@item ^-nocc^/SUPPRESS=CYCLOMATIC_COMPLEXITY^
-Do not compute the McCabe Cyclomatic Complexity
+@item ^--complexity-essential^/COMPLEXITY_METRICS=ESSENTIAL_ON^
+Report the Essential Complexity
 
-@item ^-noec^/SUPPRESS=ESSENTIAL_COMPLEXITY^
-Do not compute the Essential Complexity
+@item ^--no-complexity-essential^/COMPLEXITY_METRICS=ESSENTIAL_OFF^
+Do not report the Essential Complexity
 
-@item ^-nonl^/SUPPRESS=MAXIMAL_LOOP_NESTING^
-Do not compute maximal loop nesting level
+@item ^--loop-nesting^/COMPLEXITY_METRICS=LOOP_NESTING_ON^
+Report maximal loop nesting level
 
-@item ^-ne^/SUPPRESS=EXITS_AS_GOTOS^
+@item ^--no-loop-nesting^/COMPLEXITY_METRICS=LOOP_NESTING_OFF^
+Do not report maximal loop nesting level
+
+@item ^--complexity-average^/COMPLEXITY_METRICS=AVERAGE_COMPLEXITY_ON^
+Report the average McCabe Cyclomatic Complexity for all the subprogram bodies,
+task bodies, entry bodies and statement sequences in package bodies.
+The metric is computed and reported for whole set of processed Ada sources
+only.
+
+@item ^--no-complexity-average^/COMPLEXITY_METRICS=AVERAGE_COMPLEXITY_OFF^
+Do not report the average McCabe Cyclomatic Complexity for all the subprogram
+bodies, task bodies, entry bodies and statement sequences in package bodies
+
+@cindex @option{^-ne^/NO_EXITS_AS_GOTOS^} (@command{gnatmetric})
+@item ^-ne^/NO_EXITS_AS_GOTOS^
 Do not consider @code{exit} statements as @code{goto}s when
 computing Essential Complexity
 
@@ -16655,7 +16999,7 @@ Additional @command{gnatmetric} switches are as follows:
 @item ^-files @var{filename}^/FILES=@var{filename}^
 @cindex @option{^-files^/FILES^} (@code{gnatmetric})
 Take the argument source files from the specified file. This file should be an
-ordinary textual file containing file names separated by spaces or
+ordinary text file containing file names separated by spaces or
 line breaks. You can use this switch more then once in the same call to
 @command{gnatmetric}. You also can combine this switch with
 an explicit list of files.
@@ -16680,18 +17024,22 @@ Quiet mode.
 @node Generate project-wide metrics
 @subsection Generate project-wide metrics
 
-In order to compute metrics on all units of a given project, one can use
+In order to compute metrics on all units of a given project, you can use
 the @command{gnat} driver along with the @option{-P} option:
 @smallexample
    gnat metric -Pproj
 @end smallexample
-If the project @code{proj} depends upon other projects, one can compute
+
+@noindent
+If the project @code{proj} depends upon other projects, you can compute
 the metrics on the project closure using the @option{-U} option:
 @smallexample
    gnat metric -Pproj -U
 @end smallexample
+
+@noindent
 Finally, if not all the units are relevant to a particular main
-program in the project closure, one can generate metrics for the set
+program in the project closure, you can generate metrics for the set
 of units needed to create a given main program (unit closure) using
 the @option{-U} option followed by the name of the main unit:
 @smallexample
@@ -16730,13 +17078,15 @@ Take the unit name and replace all dots by hyphens.
 @item
 If such a replacement occurs in the
 second character position of a name, and the first character is
-^a, g, s, or i^A, G, S, or I^ then replace the dot by the character
-^~ (tilde)^$ (dollar sign)^
+^@samp{a}, @samp{g}, @samp{s}, or @samp{i}, ^@samp{A}, @samp{G}, @samp{S}, or @samp{I},^
+then replace the dot by the character
+^@samp{~} (tilde)^@samp{$} (dollar sign)^
 instead of a minus.
 @end itemize
 The reason for this exception is to avoid clashes
 with the standard names for children of System, Ada, Interfaces,
-and GNAT, which use the prefixes ^s- a- i- and g-^S- A- I- and G-^
+and GNAT, which use the prefixes
+^@samp{s-}, @samp{a-}, @samp{i-}, and @samp{g-},^@samp{S-}, @samp{A-}, @samp{I-}, and @samp{G-},^
 respectively.
 
 The @option{^-gnatk^/FILE_NAME_MAX_LENGTH=^@var{nn}}
@@ -16772,7 +17122,7 @@ $ gnatkr @var{name} /COUNT=nn
 
 @noindent
 @var{name} is the uncrunched file name, derived from the name of the unit
-in the standard manner described in the previous section (i.e. in particular
+in the standard manner described in the previous section (i.e., in particular
 all dots are replaced by hyphens). The file name may or may not have an
 extension (defined as a suffix of the form period followed by arbitrary
 characters other than period). If an extension is present then it will
@@ -16808,7 +17158,7 @@ unit and replacing the separating dots with hyphens and
 using ^lowercase^uppercase^
 for all letters, except that a hyphen in the second character position is
 replaced by a ^tilde^dollar sign^ if the first character is
-^a, i, g, or s^A, I, G, or S^.
+^@samp{a}, @samp{i}, @samp{g}, or @samp{s}^@samp{A}, @samp{I}, @samp{G}, or @samp{S}^.
 The extension is @code{.ads} for a
 specification and @code{.adb} for a body.
 Krunching does not affect the extension, but the file name is shortened to
@@ -16988,7 +17338,7 @@ being preserved in the output file.
 Causes comments to be scanned. Normally comments are ignored by gnatprep.
 If this option is specified, then comments are scanned and any $symbol
 substitutions performed as in program text. This is particularly useful
-when structured comments are used (e.g. when writing programs in the
+when structured comments are used (e.g., when writing programs in the
 SPARK dialect of Ada). Note that this switch is not available when
 doing integrated preprocessing (it would be useless in this context
 since comments are ignored by the compiler in any case).
@@ -17092,7 +17442,7 @@ The preprocessor conditional inclusion commands have the form
    lines
 #elsif @i{expression} [then]
    lines
-...
+@dots{}
 #else
    lines
 #end if;
@@ -17153,7 +17503,7 @@ preprocessor line. Any number of @code{elsif} clauses can be present,
 including none at all. The @code{else} is optional, as in Ada.
 
 The @code{#} marking the start of a preprocessor line must be the first
-non-blank character on the line, i.e. it must be preceded only by
+non-blank character on the line, i.e., it must be preceded only by
 spaces or horizontal tabs.
 
 Symbol substitution outside of preprocessor lines is obtained by using
@@ -17357,6 +17707,14 @@ version of the same source that has been modified.
 
 @table @option
 @c !sort!
+@cindex @option{--version} @command{gnatls}
+Display Copyright and version, then exit disregarding all other options.
+
+@item --help
+@cindex @option{--help} @command{gnatls}
+If @option{--version} was not used, display usage, then exit disregarding
+all other options.
+
 @item ^-a^/ALL_UNITS^
 @cindex @option{^-a^/ALL_UNITS^} (@code{gnatls})
 Consider all units, including those of the predefined Ada library.
@@ -17386,7 +17744,7 @@ Only output information about compilation units.
 @cindex @option{^-files^/FILES^} (@code{gnatls})
 Take as arguments the files listed in text file @var{file}.
 Text file @var{file} may contain empty lines that are ignored.
-Each non empty line should contain the name of an existing file.
+Each nonempty line should contain the name of an existing file.
 Several such switches may be specified simultaneously.
 
 @item ^-aO^/OBJECT_SEARCH=^@var{dir}
@@ -17595,6 +17953,14 @@ normal mode is listed, but no file is actually deleted.
 
 @table @option
 @c !sort!
+@cindex @option{--version} @command{gnatclean}
+Display Copyright and version, then exit disregarding all other options.
+
+@item --help
+@cindex @option{--help} @command{gnatclean}
+If @option{--version} was not used, display usage, then exit disregarding
+all other options.
+
 @item ^-c^/COMPILER_FILES_ONLY^
 @cindex @option{^-c^/COMPILER_FILES_ONLY^} (@code{gnatclean})
 Only attempt to delete the files produced by the compiler, not those produced
@@ -17860,9 +18226,9 @@ $ chmod -w *.ali
 @end smallexample
 
 @noindent
-Please note that the library must have a name of the form @file{libxxx.a} or
-@file{libxxx.so} (or @file{libxxx.dll} on Windows) in order to be accessed by
-the directive @option{-lxxx} at link time.
+Please note that the library must have a name of the form @file{lib@var{xxx}.a}
+or @file{lib@var{xxx}.so} (or @file{lib@var{xxx}.dll} on Windows) in order to
+be accessed by the directive @option{-l@var{xxx}} at link time.
 
 @node Installing a library
 @subsection Installing a library
@@ -17906,7 +18272,7 @@ responsibility of the library provider to install the necessary sources, ALI
 files and libraries in the directories mentioned in the project file. For
 convenience, the user's library project file should be installed in a location
 that will be searched automatically by the GNAT
-builder. These are the directories referenced in the @code{ADA_PROJECT_PATH}
+builder. These are the directories referenced in the @env{ADA_PROJECT_PATH}
 environment variable (@pxref{Importing Projects}), and also the default GNAT
 library location that can be queried with @command{gnatls -v} and is usually of
 the form $gnat_install_root/lib/gnat.
@@ -17967,7 +18333,7 @@ write:
 @smallexample @c projectfile
 with "my_lib";
 project My_Proj is
-  ...
+  @dots{}
 end My_Proj;
 @end smallexample
 
@@ -18018,11 +18384,11 @@ when the following conditions are met:
 @itemize @bullet
 @item
 @file{/dir/my_lib_src} has been added by the user to the environment
-variable @code{ADA_INCLUDE_PATH}, or by the administrator to the file
+variable @env{ADA_INCLUDE_PATH}, or by the administrator to the file
 @file{ada_source_path}
 @item
 @file{/dir/my_lib_obj} has been added by the user to the environment
-variable @code{ADA_OBJECTS_PATH}, or by the administrator to the file
+variable @env{ADA_OBJECTS_PATH}, or by the administrator to the file
 @file{ada_object_path}
 @item
 a pragma @code{Linker_Options} has been added to one of the sources.
@@ -18168,7 +18534,7 @@ the object directory.
 @item
 Copy the @code{ALI} files of the interface to the library directory,
 add in this copy an indication that it is an interface to a SAL
-(i.e. add a word @option{SL} on the line in the @file{ALI} file that starts
+(i.e., add a word @option{SL} on the line in the @file{ALI} file that starts
 with letter ``P'') and make the modified copy of the @file{ALI} file
 read-only.
 @end itemize
@@ -18322,12 +18688,12 @@ to use it.
 
 @noindent
 This chapter offers some examples of makefiles that solve specific
-problems. It does not explain how to write a makefile (see the GNU make
-documentation), nor does it try to replace the @command{gnatmake} utility
-(@pxref{The GNAT Make Program gnatmake}).
+problems. It does not explain how to write a makefile (@pxref{Top,, GNU
+make, make, GNU @code{make}}), nor does it try to replace the
+@command{gnatmake} utility (@pxref{The GNAT Make Program gnatmake}).
 
 All the examples in this section are specific to the GNU version of
-make. Although @code{make} is a standard utility, and the basic language
+make. Although @command{make} is a standard utility, and the basic language
 is the same, these examples use some advanced features found only in
 @code{GNU make}.
 
@@ -18377,7 +18743,7 @@ which might help you in case your project has a lot of subdirectories.
 ##    csc is put in the top level directory (where the Makefile is).
 ##       toplevel_dir __ first_csc  (sources) __ lib (will contain the library)
 ##                    \_ second_csc (sources) __ lib (will contain the library)
-##                    \_ ...
+##                    \_ @dots{}
 ## Although this Makefile is build for shared library, it is easy to modify
 ## to build partial link objects instead (modify the lines with -shared and
 ## gnatlink below)
@@ -18399,11 +18765,11 @@ MAIN=main
 # The following variable should give the directory containing libgnat.so
 # You can get this directory through 'gnatls -v'. This is usually the last
 # directory in the Object_Path.
-GLIB=...
+GLIB=@dots{}
 
 # The directories for the libraries
 # (This macro expands the list of CSC to the list of shared libraries, you
-# could simply use the expanded form :
+# could simply use the expanded form:
 # LIB_DIR=aa/lib/libaa.so bb/lib/libbb.so cc/lib/libcc.so
 LIB_DIR=$@{foreach dir,$@{CSC_LIST@},$@{dir@}/lib/lib$@{dir@}.so@}
 
@@ -18419,8 +18785,8 @@ objects::
 # by a new tool, gnatmlib
 $@{LIB_DIR@}:
     mkdir -p $@{dir $@@ @}
-    cd $@{dir $@@ @}; gcc -shared -o $@{notdir $@@ @} ../*.o -L$@{GLIB@} -lgnat
-    cd $@{dir $@@ @}; cp -f ../*.ali .
+    cd $@{dir $@@ @} && gcc -shared -o $@{notdir $@@ @} ../*.o -L$@{GLIB@} -lgnat
+    cd $@{dir $@@ @} && cp -f ../*.ali .
 
 # The dependencies for the modules
 # Note that we have to force the expansion of *.o, since in some cases
@@ -18449,7 +18815,7 @@ In most makefiles, you will have to specify a list of directories, and
 store it in a variable. For small projects, it is often easier to
 specify each of them by hand, since you then have full control over what
 is the proper order for these directories, which ones should be
-included...
+included.
 
 However, in larger projects, which might involve hundreds of
 subdirectories, it might be more convenient to generate this list
@@ -18457,13 +18823,13 @@ automatically.
 
 The example below presents two methods. The first one, although less
 general, gives you more control over the list. It involves wildcard
-characters, that are automatically expanded by @code{make}. Its
+characters, that are automatically expanded by @command{make}. Its
 shortcoming is that you need to explicitly specify some of the
 organization of your project, such as for instance the directory tree
-depth, whether some directories are found in a separate tree,...
+depth, whether some directories are found in a separate tree, @enddots{}
 
 The second method is the most general one. It requires an external
-program, called @code{find}, which is standard on all Unix systems. All
+program, called @command{find}, which is standard on all Unix systems. All
 the directories found under a given root directory will be added to the
 list.
 
@@ -18851,7 +19217,7 @@ It provides three type of information:
 @item
 General information concerning memory management, such as the total
 number of allocations and deallocations, the amount of allocated
-memory and the high water mark, i.e. the largest amount of allocated
+memory and the high water mark, i.e.@: the largest amount of allocated
 memory in the course of program execution.
 
 @item
@@ -18917,7 +19283,7 @@ version of that library that has been compiled with the @option{-g} switch
 
 Gnatmem must be supplied with the @file{gmem.out} file and the executable to
 examine. If the location of @file{gmem.out} file was not explicitly supplied by
-@code{-i} switch, gnatmem will assume that this file can be found in the
+@option{-i} switch, gnatmem will assume that this file can be found in the
 current directory. For example, after you have executed @file{my_program},
 @file{gmem.out} can be analyzed by @code{gnatmem} using the command:
 
@@ -19118,7 +19484,7 @@ Allocation Root # 3
 Note that the GNAT run time contains itself a certain number of
 allocations that have no  corresponding deallocation,
 as shown here for root #2 and root
-#3. This is a normal behavior when the number of non freed allocations
+#3. This is a normal behavior when the number of non-freed allocations
 is one, it allocates dynamic data structures that the run time needs for
 the complete lifetime of the program. Note also that there is only one
 allocation root in the user program with a single line back trace:
@@ -19243,9 +19609,10 @@ For the environment task, the stack size depends on
 system defaults and is unknown to the compiler. Stack checking
 may still work correctly if a fixed
 size stack is allocated, but this cannot be guaranteed.
+@ifclear vms
 To ensure that a clean exception is signalled for stack
 overflow, set the environment variable
-@code{GNAT_STACK_LIMIT} to indicate the maximum
+@env{GNAT_STACK_LIMIT} to indicate the maximum
 stack area that can be used, as in:
 @cindex GNAT_STACK_LIMIT
 
@@ -19261,6 +19628,27 @@ of stack used by the environment task. If it is necessary to
 increase the amount of stack for the environment task, then this
 is an operating systems issue, and must be addressed with the
 appropriate operating systems commands.
+@end ifclear
+@ifset vms
+To have a fixed size stack in the environment task, the stack must be put
+in the P0 address space and its size specified.  Use these switches to
+create a p0 image:
+
+@smallexample
+gnatmake my_progs -largs "-Wl,--opt=STACK=4000,/p0image"
+@end smallexample
+
+@noindent
+The quotes are required to keep case.  The number after @samp{STACK=} is the
+size of the environmental task stack in pagelets (512 bytes).  In this example
+the stack size is about 2 megabytes.
+
+@noindent
+A consequence of the @option{/p0image} qualifier is also to makes RMS buffers
+be placed in P0 space.  Refer to @cite{HP OpenVMS Linker Utility Manual} for
+more details about the @option{/p0image} qualifier and the @option{stack}
+option.
+@end ifset
 
 @node Static Stack Usage Analysis
 @section Static Stack Usage Analysis
@@ -19317,7 +19705,7 @@ With this option, at each task termination, its stack usage is  output on
 It is not always convenient to output the stack usage when the program
 is still running. Hence, it is possible to delay this output until program
 termination. for a given number of tasks specified as the argument of the
-@code{-u} option. For instance:
+@option{-u} option. For instance:
 
 @smallexample
 $ gnatbind -u100 file
@@ -19353,7 +19741,7 @@ and max values.
 @end table
 
 @noindent
-The environment task stack, e.g. the stack that contains the main unit, is
+The environment task stack, e.g., the stack that contains the main unit, is
 only processed when the environment variable GNAT_STACK_LIMIT is set.
 
 
@@ -19613,15 +20001,15 @@ To record compiler style checks, use the rule named
 @code{Style_Checks}. A parameter of this rule can be either @code{All_Checks},
 which enables all the style checks, or a string that has exactly the same
 structure and semantics as the @code{string_LITERAL} parameter of GNAT pragma
-@code{Style_Checks} (for further information about this pragma, please
-refer to the @cite{@value{EDITION} Reference Manual}).
+@code{Style_Checks} (for further information about this pragma,
+@pxref{Pragma Style_Checks,,, gnat_rm, GNAT Reference Manual}).
 
 @item Warnings
 To record compiler warnings (@pxref{Warning Message Control}), use the rule
 named @code{Warnings} with a parameter that is a valid
 @i{static_string_expression} argument of GNAT pragma @code{Warnings}
-(for further information about this pragma, please
-refer to the @cite{@value{EDITION} Reference Manual}).
+(for further information about this pragma, @pxref{Pragma Warnings,,,
+gnat_rm, GNAT Reference Manual}).
 
 @end table
 
@@ -19801,7 +20189,7 @@ flagged (since @code{1..N} is formally a ``range''):
 
 @smallexample @c ada
 for I in 1 .. N loop
-   ...
+   @dots{}
 end loop;
 @end smallexample
 
@@ -19810,9 +20198,9 @@ Declaring an explicit subtype solves the problem:
 
 @smallexample @c ada
 subtype S is Integer range 1..N;
-...
+@dots{}
 for I in S loop
-   ...
+   @dots{}
 end loop;
 @end smallexample
 
@@ -19949,7 +20337,7 @@ All forms for specifying a range (explicit ranges
 such as @code{A .. B}, subtype marks and @code{'Range} attributes) are flagged.
 An enumeration range is
 flagged even if contains exactly one enumeration value or no values at all. A
-type derived fom an enumeration type is considered as an enumeration type.
+type derived from an enumeration type is considered as an enumeration type.
 
 This rule helps prevent maintenance problems arising from adding an
 enumeration value to a type and having it implicitly handled by an existing
@@ -19963,7 +20351,7 @@ This rule has no parameters.
 @cindex @code{Exceptions_As_Control_Flow} (for @command{gnatcheck})
 
 @noindent
-Flag each place where an exception is explictly raised and handled in the
+Flag each place where an exception is explicitly raised and handled in the
 same subprogram body. A @code{raise} statement in an exception handler,
 package body, task body or entry body is not flagged.
 
@@ -20031,8 +20419,8 @@ checked and sets the checks for all the specified pragmas
 ON. @emph{Pragma_Name} is treated as a name of a pragma. If it
 does not correspond to any pragma name defined in the Ada
 standard or to the name of a GNAT-specific pragma defined
-in the GNAT Reference Manual, it is treated as the name of
-unknown pragma.
+in @ref{Implementation Defined Pragmas,,, gnat_rm, GNAT Reference
+Manual}, it is treated as the name of unknown pragma.
 
 @item @code{GNAT}
 All the GNAT-specific pragmas are detected; this sets
@@ -20049,10 +20437,9 @@ Removes the specified pragma from the set of pragmas to be
 checked without affecting checks for
 other pragmas. @emph{Pragma_Name} is treated as a name
 of a pragma. If it does not correspond to any pragma
-defined in the Ada standard or to any name defined in the
-GNAT Reference Manual,
-this option is treated as turning OFF detection of all
-unknown pragmas.
+defined in the Ada standard or to any name defined in
+@ref{Implementation Defined Pragmas,,, gnat_rm, GNAT Reference Manual},
+this option is treated as turning OFF detection of all unknown pragmas.
 
 @item GNAT
 Turn OFF detection of all GNAT-specific pragmas
@@ -20094,13 +20481,13 @@ affect the set of pragmas to be detected.
 Flag each procedure that can be rewritten as a function. A procedure can be
 converted into a function if it has exactly one parameter of mode @code{out}
 and no parameters of mode @code{in out}. Procedure declarations,
-formal procedure declarations. and generic procedure declarations are always
+formal procedure declarations, and generic procedure declarations are always
 checked. Procedure
 bodies and body stubs are flagged only if they do not have corresponding
 separate declarations. Procedure renamings and procedure instantiations are
 not flagged.
 
-If a procedure can be rewritten as a fucntion, but its @code{out} parameter is
+If a procedure can be rewritten as a function, but its @code{out} parameter is
 of a limited type, it is not flagged.
 
 Protected procedures are not flagged. Null procedures also are not flagged.
@@ -20113,7 +20500,7 @@ This rule has no parameters.
 @cindex @code{Generics_In_Subprograms} rule (for @command{gnatcheck})
 
 @noindent
-Flag each declaration of a generic unit in a supbrogram. Generic
+Flag each declaration of a generic unit in a subprogram. Generic
 declarations in the bodies of generic subprograms are also flagged.
 A generic unit nested in another generic unit is not flagged.
 If a generic unit is
@@ -21184,6 +21571,10 @@ into the body stub.
 @cindex @option{^-hg^/HEADER=GENERAL^} (@command{gnatstub})
 Put a sample comment header into the body stub.
 
+@item ^--header-file=@var{filename}^/FROM_HEADER_FILE=@var{filename}^
+@cindex @option{^--header-file^/FROM_HEADER_FILE=^} (@command{gnatstub})
+Use the content of the file as the comment header for a generated body stub.
+
 @ifclear vms
 @item -IDIR
 @cindex @option{-IDIR} (@command{gnatstub})
@@ -21409,7 +21800,7 @@ You can pass it as many Ada files as you want. @code{gnathtml} will generate
 an html file for every ada file, and a global file called @file{index.htm}.
 This file is an index of every identifier defined in the files.
 
-The available ^switches^options^ are the following ones :
+The available ^switches^options^ are the following ones:
 
 @table @option
 @item -83
@@ -21441,7 +21832,7 @@ If you do not specify an extension, it will default to @file{htm}.
 @item -f
 @cindex @option{-f} (@code{gnathtml})
 By default, gnathtml will generate html links only for global entities
-('with'ed units, global variables and types,...). If you specify
+('with'ed units, global variables and types,@dots{}).  If you specify
 @option{-f} on the command line, then links will be generated for local
 entities too.
 
@@ -21498,7 +21889,7 @@ Operating System via the Internet.
 
 On Unix systems, you  may want to modify  the  first line of  the script
 @code{gnathtml},  to explicitly  tell  the Operating  system  where Perl
-is. The syntax of this line is :
+is. The syntax of this line is:
 @smallexample
 #!full_path_name_to_perl
 @end smallexample
@@ -21537,6 +21928,291 @@ $ RUN/DEBUG <PROGRAM_NAME>
 @noindent
 @end ifset
 
+@ifclear vms
+@c ******************************
+@node Code Coverage and Profiling
+@chapter Code Coverage and Profiling
+@cindex Code Coverage
+@cindex Profiling
+
+@noindent
+This chapter describes how to use @code{gcov} - coverage testing tool - and
+@code{gprof} - profiler tool - on your Ada programs.
+
+@menu
+* Code Coverage of Ada Programs using gcov::
+* Profiling an Ada Program using gprof::
+@end menu
+
+@node Code Coverage of Ada Programs using gcov
+@section Code Coverage of Ada Programs using gcov
+@cindex gcov
+@cindex -fprofile-arcs
+@cindex -ftest-coverage
+@cindex -coverage
+@cindex Code Coverage
+
+@noindent
+@code{gcov} is a test coverage program: it analyzes the execution of a given
+program on selected tests, to help you determine the portions of the program
+that are still untested.
+
+@code{gcov} is part of the GCC suite, and is described in detail in the GCC
+User's Guide. You can refer to this documentation for a more complete
+description.
+
+This chapter provides a quick startup guide, and
+details some Gnat-specific features.
+
+@menu
+* Quick startup guide::
+* Gnat specifics::
+@end menu
+
+@node Quick startup guide
+@subsection Quick startup guide
+
+In order to perform coverage analysis of a program using @code{gcov}, 3
+steps are needed:
+
+@itemize @bullet
+@item
+Code instrumentation during the compilation process
+@item
+Execution of the instrumented program
+@item
+Execution of the @code{gcov} tool to generate the result.
+@end itemize
+
+The code instrumentation needed by gcov is created at the object level:
+The source code is not modified in any way, because the instrumentation code is
+inserted by gcc during the compilation process. To compile your code with code
+coverage activated, you need to recompile your whole project using the
+switches
+@code{-fprofile-arcs} and @code{-ftest-coverage}, and link it using
+@code{-fprofile-arcs}.
+
+@smallexample
+$ gnatmake -P my_project.gpr -f -cargs -fprofile-arcs -ftest-coverage \
+   -largs -fprofile-arcs
+@end smallexample
+
+This compilation process will create @file{.gcno} files together with
+the usual object files.
+
+Once the program is compiled with coverage instrumentation, you can
+run it as many times as needed - on portions of a test suite for
+example. The first execution will produce @file{.gcda} files at the
+same location as the @file{.gcno} files.  The following executions
+will update those files, so that a cumulative result of the covered
+portions of the program is generated.
+
+Finaly, you need to call the @code{gcov} tool. The different options of
+@code{gcov} are available in the GCC User's Guide, section 'Invoking gcov'.
+
+This will create anotated source files with a @file{.gcov} extension:
+@file{my_main.adb} file will be analysed in @file{my_main.adb.gcov}.
+
+@node Gnat specifics
+@subsection Gnat specifics
+
+Because Ada semantics, portions of the source code may be shared among
+several object files. This is the case for example when generics are
+involved, when inlining is active  or when declarations generate  initialisation
+calls. In order to take
+into account this shared code, you need to call @code{gcov} on all
+source files of the tested program at once.
+
+The list of source files might exceed the system's maximum command line
+length. In order to bypass this limitation, a new mechanism has been
+implemented in @code{gcov}: you can now list all your project's files into a
+text file, and provide this file to gcov as a parameter,  preceded by a @@
+(e.g. @samp{gcov @@mysrclist.txt}).
+
+@node Profiling an Ada Program using gprof
+@section Profiling an Ada Program using gprof
+@cindex gprof
+@cindex -pg
+@cindex Profiling
+
+@noindent
+This section is not meant to be an exhaustive documentation of @code{gprof}.
+Full documentation for it can be found in the GNU Profiler User's Guide
+documentation that is part of this GNAT distribution.
+
+Profiling a program helps determine the parts of a program that are executed
+most often, and are therefore the most time-consuming.
+
+@code{gprof} is the standard GNU profiling tool; it has been enhanced to
+better handle Ada programs and multitasking.
+It is currently supported on the following platoforms
+@itemize @bullet
+@item
+linux x86/x86_64
+@item
+solaris sparc/sparc64/x86
+@item
+windows x86
+@end itemize
+
+@noindent
+In order to profile a program using @code{gprof}, 3 steps are needed:
+
+@itemize @bullet
+@item
+Code instrumentation, requiring a full recompilation of the project with the
+proper switches.
+@item
+Execution of the program under the analysis conditions, i.e. with the desired
+input.
+@item
+Analysis of the results using the @code{gprof} tool.
+@end itemize
+
+@noindent
+The following sections detail the different steps, and indicate how
+to interpret the results:
+@menu
+* Compilation for profiling::
+* Program execution::
+* Running gprof::
+* Interpretation of profiling results::
+@end menu
+
+@node Compilation for profiling
+@subsection Compilation for profiling
+@cindex -pg
+@cindex Profiling
+
+In order to profile a program the first step is to tell the compiler
+to generate the necessary profiling information. The compiler switch to be used
+is @code{-pg}, which must be added to other compilation switches. This
+switch needs to be specified both during compilation and link stages, and can
+be specified once when using gnatmake:
+
+@smallexample
+gnatmake -f -pg -P my_project
+@end smallexample
+
+@noindent
+Note that only the objects that were compiled with the @samp{-pg} switch will be
+profiled; if you need to profile your whole project, use the
+@samp{-f} gnatmake switch to force full recompilation.
+
+@node Program execution
+@subsection Program execution
+
+@noindent
+Once the program has been compiled for profiling, you can run it as usual.
+
+The only constraint imposed by profiling is that the program must terminate
+normally. An interrupted program (via a Ctrl-C, kill, etc.) will not be
+properly analyzed.
+
+Once the program completes execution, a data file called @file{gmon.out} is
+generated in the directory where the program was launched from. If this file
+already exists, it will be overwritten.
+
+@node Running gprof
+@subsection Running gprof
+
+@noindent
+The @code{gprof} tool is called as follow:
+
+@smallexample
+gprof my_prog gmon.out
+@end smallexample
+
+@noindent
+or simpler:
+
+@smallexample
+gprof my_prog
+@end smallexample
+
+@noindent
+The complete form of the gprof command line is the following:
+
+@smallexample
+gprof [^switches^options^] [executable [data-file]]
+@end smallexample
+
+@noindent
+@code{gprof} supports numerous ^switch^options^. The order of these
+^switch^options^ does not matter. The full list of options can be found in
+the GNU Profiler User's Guide documentation that comes with this documentation.
+
+The following is the subset of those switches that is most relevant:
+
+@table @option
+
+@item --demangle[=@var{style}]
+@itemx --no-demangle
+@cindex @option{--demangle} (@code{gprof})
+These options control whether symbol names should be demangled when
+printing output.  The default is to demangle C++ symbols.  The
+@code{--no-demangle} option may be used to turn off demangling. Different
+compilers have different mangling styles.  The optional demangling style
+argument can be used to choose an appropriate demangling style for your
+compiler, in particular Ada symbols generated by GNAT can be demangled using
+@code{--demangle=gnat}.
+
+@item -e @var{function_name}
+@cindex @option{-e} (@code{gprof})
+The @samp{-e @var{function}} option tells @code{gprof} not to print
+information about the function @var{function_name} (and its
+children@dots{}) in the call graph.  The function will still be listed
+as a child of any functions that call it, but its index number will be
+shown as @samp{[not printed]}.  More than one @samp{-e} option may be
+given; only one @var{function_name} may be indicated with each @samp{-e}
+option.
+
+@item -E @var{function_name}
+@cindex @option{-E} (@code{gprof})
+The @code{-E @var{function}} option works like the @code{-e} option, but
+execution time spent in the function (and children who were not called from
+anywhere else), will not be used to compute the percentages-of-time for
+the call graph.  More than one @samp{-E} option may be given; only one
+@var{function_name} may be indicated with each @samp{-E} option.
+
+@item -f @var{function_name}
+@cindex @option{-f} (@code{gprof})
+The @samp{-f @var{function}} option causes @code{gprof} to limit the
+call graph to the function @var{function_name} and its children (and
+their children@dots{}).  More than one @samp{-f} option may be given;
+only one @var{function_name} may be indicated with each @samp{-f}
+option.
+
+@item -F @var{function_name}
+@cindex @option{-F} (@code{gprof})
+The @samp{-F @var{function}} option works like the @code{-f} option, but
+only time spent in the function and its children (and their
+children@dots{}) will be used to determine total-time and
+percentages-of-time for the call graph.  More than one @samp{-F} option
+may be given; only one @var{function_name} may be indicated with each
+@samp{-F} option.  The @samp{-F} option overrides the @samp{-E} option.
+
+@end table
+
+@node Interpretation of profiling results
+@subsection Interpretation of profiling results
+
+@noindent
+
+The results of the profiling analysis are represented by two arrays: the
+'flat profile' and the 'call graph'. Full documentation of those outputs
+can be found in the GNU Profiler User's Guide.
+
+The flat profile shows the time spent in each function of the program, and how
+many time it has been called. This allows you to locate easily the most
+time-consuming functions.
+
+The call graph shows, for each subprogram, the subprograms that call it,
+and the subprograms that it calls. It also provides an estimate of the time
+spent in each of those callers/called subprograms.
+@end ifclear
+
+@c ******************************
 @node Running and Debugging Ada Programs
 @chapter Running and Debugging Ada Programs
 @cindex Debugging
@@ -21598,11 +22274,11 @@ and in particular is capable of debugging Ada programs compiled with
 GNAT. The latest versions of @code{GDB} are Ada-aware and can handle
 complex Ada data structures.
 
-The manual @cite{Debugging with GDB}
+@xref{Top,, Debugging with GDB, gdb, Debugging with GDB},
 @ifset vms
-located in the GNU:[DOCS] directory,
+located in the GNU:[DOCS] directory,
 @end ifset
-contains full details on the usage of @code{GDB}, including a section on
+for full details on the usage of @code{GDB}, including a section on
 its usage on programs. This manual should be consulted for full
 details. The section that follows is a brief introduction to the
 philosophy and use of @code{GDB}.
@@ -21614,9 +22290,9 @@ separate from the generated code. It makes the object files considerably
 larger, but it does not add to the size of the actual executable that
 will be loaded into memory, and has no impact on run-time performance. The
 generation of debug information is triggered by the use of the
-^-g^/DEBUG^ switch in the gcc or gnatmake command used to carry out
-the compilations. It is important to emphasize that the use of these
-options does not change the generated code.
+^-g^/DEBUG^ switch in the @command{gcc} or @command{gnatmake} command
+used to carry out the compilations. It is important to emphasize that
+the use of these options does not change the generated code.
 
 The debugging information is written in standard system formats that
 are used by many tools, including debuggers and profilers. The format
@@ -21682,14 +22358,14 @@ describes some of the additional commands that can be given to @code{GDB}.
 @section Introduction to GDB Commands
 
 @noindent
-@code{GDB} contains a large repertoire of commands. The manual
-@cite{Debugging with GDB}
+@code{GDB} contains a large repertoire of commands.  @xref{Top,,
+Debugging with GDB, gdb, Debugging with GDB},
 @ifset vms
-(located in the GNU:[DOCS] directory)
+located in the GNU:[DOCS] directory,
 @end ifset
-includes extensive documentation on the use
+for extensive documentation on the use
 of these commands, together with examples of their use. Furthermore,
-the command @var{help} invoked from within @code{GDB} activates a simple help
+the command @command{help} invoked from within GDB activates a simple help
 facility which summarizes the available commands and their options.
 In this section we summarize a few of the most commonly
 used commands to give an idea of what @code{GDB} is about. You should create
@@ -21782,8 +22458,8 @@ The above list is a very short introduction to the commands that
 @code{GDB} provides. Important additional capabilities, including conditional
 breakpoints, the ability to execute command sequences on a breakpoint,
 the ability to debug at the machine instruction level and many other
-features are described in detail in @cite{Debugging with GDB}.
-Note that most commands can be abbreviated
+features are described in detail in @ref{Top,, Debugging with GDB, gdb,
+Debugging with GDB}.  Note that most commands can be abbreviated
 (for example, c for continue, bt for backtrace).
 
 @node Using Ada Expressions
@@ -21816,7 +22492,8 @@ packages, thus making it unnecessary to fully qualify most names with
 their packages, regardless of context. Where this causes ambiguity,
 @code{GDB} asks the user's intent.
 
-For details on the supported Ada syntax, see @cite{Debugging with GDB}.
+For details on the supported Ada syntax, see @ref{Top,, Debugging with
+GDB, gdb, Debugging with GDB}.
 
 @node Calling User-Defined Subprograms
 @section Calling User-Defined Subprograms
@@ -21976,7 +22653,7 @@ perturbed.
 
 @noindent
 For more detailed information on the tasking support,
-see @cite{Debugging with GDB}.
+see @ref{Top,, Debugging with GDB, gdb, Debugging with GDB}.
 
 @node Debugging Generic Units
 @section Debugging Generic Units
@@ -22299,8 +22976,8 @@ $ addr2line --exe=stb 0x401373 0x40138b 0x40139c 0x401335 0x4011c4
 0040138B at d:/stb/stb.adb:10
 0040139C at d:/stb/stb.adb:14
 00401335 at d:/stb/b~stb.adb:104
-004011C4 at /build/.../crt1.c:200
-004011F1 at /build/.../crt1.c:222
+004011C4 at /build/@dots{}/crt1.c:200
+004011F1 at /build/@dots{}/crt1.c:222
 77E892A4 in ?? at ??:0
 @end smallexample
 
@@ -22324,8 +23001,8 @@ $ addr2line --exe=stb --functions --demangle=gnat 0x401373 0x40138b
 0040138B in stb.p2 at d:/stb/stb.adb:10
 0040139C in stb at d:/stb/stb.adb:14
 00401335 in main at d:/stb/b~stb.adb:104
-004011C4 in <__mingw_CRTStartup> at /build/.../crt1.c:200
-004011F1 in <mainCRTStartup> at /build/.../crt1.c:222
+004011C4 in <__mingw_CRTStartup> at /build/@dots{}/crt1.c:200
+004011F1 in <mainCRTStartup> at /build/@dots{}/crt1.c:222
 @end smallexample
 
 @noindent
@@ -22635,9 +23312,9 @@ GNAT always follows the Alpha implementation.
 
 For GNAT running on other than VMS systems, all the HP Ada 83 pragmas and
 attributes are recognized, although only a subset of them can sensibly
-be implemented.  The description of pragmas in the
-@cite{GNAT Reference Manual} indicates whether or not they are applicable
-to non-VMS systems.
+be implemented.  The description of pragmas in
+@xref{Implementation Defined Pragmas,,, gnat_rm, GNAT Reference Manual}
+indicates whether or not they are applicable to non-VMS systems.
 
 @menu
 * Ada Language Compatibility::
@@ -22737,7 +23414,7 @@ use  System.Aux_DEC;
 The effect is not quite semantically identical to incorporating
 the declarations directly into package @code{System},
 but most programs will not notice a difference
-unless they use prefix notation (e.g. @code{System.Integer_8})
+unless they use prefix notation (e.g.@: @code{System.Integer_8})
 to reference the entities directly in package @code{System}.
 For units containing such references,
 the prefixes must either be removed, or the pragma @code{Extend_System}
@@ -22923,7 +23600,7 @@ fixed-point types are truncated.
 @subsection Record and Array Component Alignment
 
 @noindent
-On HP Ada for OpenVMS Alpha, all non composite components
+On HP Ada for OpenVMS Alpha, all non-composite components
 are aligned on natural boundaries. For example, 1-byte
 components are aligned on byte boundaries, 2-byte
 components on 2-byte boundaries, 4-byte components on 4-byte
@@ -22970,7 +23647,7 @@ of declarations:
 @cartouche
 X, Y : Integer := Init_Func;
 Q : String (X .. Y) := "abc";
-...
+@dots{}
 for Q'Address use Compute_Address;
 @end cartouche
 @end smallexample
@@ -22985,7 +23662,7 @@ that @code{Q} is declared. To achieve the intended effect, write instead:
 X, Y : Integer := Init_Func;
 Q_Address : constant Address := Compute_Address;
 Q : String (X .. Y) := "abc";
-...
+@dots{}
 for Q'Address use Q_Address;
 @end cartouche
 @end group
@@ -22994,7 +23671,8 @@ for Q'Address use Q_Address;
 @noindent
 which will be accepted by GNAT (and other Ada compilers), and is also
 compatible with Ada 83. A fuller description of the restrictions
-on address specifications is found in the @cite{GNAT Reference Manual}.
+on address specifications is found in @ref{Top, GNAT Reference Manual,
+About This Guide, gnat_rm, GNAT Reference Manual}.
 
 @node Other Representation Clauses
 @subsection Other Representation Clauses
@@ -23081,8 +23759,8 @@ pragma Extend_System (Aux_DEC);
 
 @noindent
 The pragma @code{Extend_System} is a configuration pragma that
-is most conveniently placed in the @file{gnat.adc} file. See the
-@cite{GNAT Reference Manual} for further details.
+is most conveniently placed in the @file{gnat.adc} file. @xref{Pragma
+Extend_System,,, gnat_rm, GNAT Reference Manual} for further details.
 
 HP Ada does not allow the recompilation of the package
 @code{SYSTEM}. Instead HP Ada provides several pragmas
@@ -23113,8 +23791,8 @@ are virtually identical to those provided by the HP Ada 83 package
 @code{TO_ADDRESS}
 function for type @code{UNSIGNED_LONGWORD} is changed to
 @code{TO_ADDRESS_LONG}.
-See the @cite{GNAT Reference Manual} for a discussion of why this change was
-necessary.
+@xref{Address Clauses,,, gnat_rm, GNAT Reference Manual} for a
+discussion of why this change was necessary.
 
 @noindent
 The version of @code{TO_ADDRESS} taking a @i{universal_integer} argument
@@ -23443,8 +24121,9 @@ GNAT also supplies a number of implementation-defined pragmas as follows:
 @end itemize
 
 @noindent
-For full details on these GNAT implementation-defined pragmas, see
-the GNAT Reference Manual.
+For full details on these GNAT implementation-defined pragmas,
+see @ref{Implementation Defined Pragmas,,, gnat_rm, GNAT Reference
+Manual}.
 
 @menu
 * Restrictions on the Pragma INLINE::
@@ -23686,8 +24365,7 @@ Interfacing to C with GNAT, you can use the above approach
 described for HP Ada or the facilities of Annex B of
 the @cite{Ada Reference Manual} (packages @code{INTERFACES.C},
 @code{INTERFACES.C.STRINGS} and @code{INTERFACES.C.POINTERS}). For more
-information, see the section ``Interfacing to C'' in the
-@cite{GNAT Reference Manual}.
+information, see @ref{Interfacing to C,,, gnat_rm, GNAT Reference Manual}.
 
 The @option{-gnatF} qualifier forces default and explicit
 @code{External_Name} parameters in pragmas @code{Import} and @code{Export}
@@ -24058,8 +24736,8 @@ by the @cite{Ada 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 @cite{GNAT Reference Manual}.
+mixed languages, see @ref{Implementation of the Standard I/O,,,
+gnat_rm, GNAT Reference Manual}.
 This chapter covers the following:
 @itemize @bullet
 @item  Standard I/O packages
@@ -24341,6 +25019,7 @@ information about several specific platforms.
 * Solaris-Specific Considerations::
 * Linux-Specific Considerations::
 * AIX-Specific Considerations::
+* Irix-Specific Considerations::
 @end menu
 
 @node Summary of Run-Time Configurations
@@ -24608,8 +25287,8 @@ and can thus execute on multiple processors.
 The user can alternatively specify a processor on which the program should run
 to emulate a single-processor system. The multiprocessor / uniprocessor choice
 is made by
-setting the environment variable @code{GNAT_PROCESSOR}
-@cindex @code{GNAT_PROCESSOR} environment variable (on Sparc Solaris)
+setting the environment variable @env{GNAT_PROCESSOR}
+@cindex @env{GNAT_PROCESSOR} environment variable (on Sparc Solaris)
 to one of the following:
 
 @table @code
@@ -24636,7 +25315,7 @@ Run the program on the specified processor.
 On GNU/Linux without NPTL support (usually system with GNU C Library
 older than 2.3), the signal model is not POSIX compliant, which means
 that to send a signal to the process, you need to send the signal to all
-threads, e.g. by using @code{killpg()}.
+threads, e.g.@: by using @code{killpg()}.
 
 @node AIX-Specific Considerations
 @section AIX-Specific Considerations
@@ -24657,6 +25336,24 @@ occurs in the environment task, or use @code{pragma Storage_Size} to
 specify a sufficiently large size for the stack of the task that contains
 this call.
 
+@node Irix-Specific Considerations
+@section Irix-Specific Considerations
+@cindex Irix libraries
+
+@noindent
+The GCC support libraries coming with the Irix compiler have moved to
+their canonical place with respect to the general Irix ABI related
+conventions. Running applications built with the default shared GNAT
+run-time now requires the LD_LIBRARY_PATH environment variable to
+include this location. A possible way to achieve this is to issue the
+following command line on a bash prompt:
+
+@smallexample
+@group
+$  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`dirname \`gcc --print-file-name=libgcc_s.so\``
+@end group
+@end smallexample
+
 @c *******************************
 @node Example of Binder Output File
 @appendix Example of Binder Output File
@@ -25293,7 +25990,7 @@ package body ada_main is
       --  pragma Import because if we try to with the unit and
       --  call it Ada style, then not only do we waste time
       --  recompiling it, but also, we don't really know the right
-      --  switches (e.g. identifier character set) to be used
+      --  switches (e.g.@: identifier character set) to be used
       --  to compile it.
 
       procedure Ada_Main_Program;
@@ -25463,7 +26160,7 @@ of that unit before elaborating the unit doing the @code{with}'ing:
 @group
 @cartouche
 with Unit_1;
-package Unit_2 is ...
+package Unit_2 is @dots{}
 @end cartouche
 @end group
 @end smallexample
@@ -25583,7 +26280,7 @@ is impossible to guarantee a safe order of elaboration at run time.
 
 @noindent
 In some languages that involve the same kind of elaboration problems,
-e.g. Java and C++, the programmer is expected to worry about these
+e.g.@: Java and C++, the programmer is expected to worry about these
 ordering problems himself, and it is common to
 write a program in which an incorrect elaboration order  gives
 surprising results, because it references variables before they
@@ -25895,7 +26592,7 @@ to use @code{Elaborate_All} on such units.
 @section Controlling Elaboration in GNAT - Internal Calls
 
 @noindent
-In the case of internal calls, i.e. calls within a single package, the
+In the case of internal calls, i.e., calls within a single package, the
 programmer has full control over the order of elaboration, and it is up
 to the programmer to elaborate declarations in an appropriate order. For
 example writing:
@@ -26122,7 +26819,7 @@ end Math;
 package body Math is
    function Sqrt (Arg : Float) return Float is
    begin
-         ...
+         @dots{}
    end Sqrt;
 end Math;
 @end group
@@ -26135,7 +26832,7 @@ end Stuff;
 with Stuff;
 procedure Main is
 begin
-   ...
+   @dots{}
 end Main;
 @end group
 @end cartouche
@@ -26182,15 +26879,15 @@ that is not a general rule that can be followed in all cases. Consider
 @smallexample @c ada
 @group
 @cartouche
-package X is ...
+package X is @dots{}
 
-package Y is ...
+package Y is @dots{}
 
 with X;
-package body Y is ...
+package body Y is @dots{}
 
 with Y;
-package body X is ...
+package body X is @dots{}
 @end cartouche
 @end group
 @end smallexample
@@ -26204,7 +26901,7 @@ the body of @code{X} @code{with}'s @code{Y},
 which means you would have to
 elaborate the body of @code{Y} first, but that @code{with}'s @code{X},
 which means
-you have to elaborate the body of @code{X} first, but ... and we have a
+you have to elaborate the body of @code{X} first, but @dots{} and we have a
 loop that cannot be broken.
 
 It is true that the binder can in many cases guess an order of elaboration
@@ -26488,7 +27185,7 @@ Here is the exact chain of events we are worrying about:
 In the body of @code{Decls} a call is made from within the body of a library
 task to a subprogram in the package @code{Utils}. Since this call may
 occur at elaboration time (given that the task is activated at elaboration
-time), we have to assume the worst, i.e. that the
+time), we have to assume the worst, i.e., that the
 call does happen at elaboration time.
 
 @item
@@ -26620,7 +27317,7 @@ Declare separate task types.
 
 A significant part of the problem arises because of the use of the
 single task declaration form. This means that the elaboration of
-the task type, and the elaboration of the task itself (i.e. the
+the task type, and the elaboration of the task itself (i.e.@: the
 creation of the task) happen at the same time. A good rule
 of style in Ada is to always create explicit task types. By
 following the additional step of placing task objects in separate
@@ -27316,9 +28013,9 @@ constants to control which code is executed.
 @smallexample @c ada
 @group
 FP_Initialize_Required : constant Boolean := True;
-...
+@dots{}
 if FP_Initialize_Required then
-...
+@dots{}
 end if;
 @end group
 @end smallexample
@@ -27342,7 +28039,7 @@ something like:
 package Config is
    FP_Initialize_Required : constant Boolean := True;
    Reset_Available        : constant Boolean := False;
-   ...
+   @dots{}
 end Config;
 @end group
 @end smallexample
@@ -27390,8 +28087,9 @@ a pragma @code{Assert} that can be used for such tests. This pragma is modeled
 @cindex pragma @code{Assert}
 on the @code{Assert} pragma that has always been available in GNAT, so this
 feature may be used with GNAT even if you are not using Ada 2005 features.
-The use of pragma @code{Assert} is described in the
-@cite{GNAT Reference Manual}, but as an example, the last test could be written:
+The use of pragma @code{Assert} is described in
+@ref{Pragma Assert,,, gnat_rm, GNAT Reference Manual}, but as an
+example, the last test could be written:
 
 @smallexample @c ada
 pragma Assert (Temperature <= 999.0, "Temperature Crazy");
@@ -27461,8 +28159,8 @@ to add a @code{null} statement.
 
 @smallexample @c ada
 @group
-if ... then
-   ... -- some statements
+if @dots{} then
+   @dots{} -- some statements
 else
    pragma Assert (Num_Cases < 10);
    null;
@@ -27488,13 +28186,13 @@ if Small_Machine then
    declare
       X : Bit_String (1 .. 10);
    begin
-      ...
+      @dots{}
    end;
 else
    declare
       X : Large_Bit_String (1 .. 1000);
    begin
-      ...
+      @dots{}
    end;
 end if;
 @end group
@@ -27505,8 +28203,8 @@ Note that in this approach, both declarations are analyzed by the
 compiler so this can only be used where both declarations are legal,
 even though one of them will not be used.
 
-Another approach is to define integer constants, e.g. @code{Bits_Per_Word}, or
-Boolean constants, e.g. @code{Little_Endian}, and then write declarations
+Another approach is to define integer constants, e.g.@: @code{Bits_Per_Word}, or
+Boolean constants, e.g.@: @code{Little_Endian}, and then write declarations
 that are parameterized by these constants. For example
 
 @smallexample @c ada
@@ -27574,9 +28272,9 @@ to compile with an Ada 95 compiler. Conceptually you want to say:
 @smallexample @c ada
 @group
 if Ada_2005 then
-   ... neat Ada 2005 code
+   @dots{} neat Ada 2005 code
 else
-   ... not quite as neat Ada 95 code
+   @dots{} not quite as neat Ada 95 code
 end if;
 @end group
 @end smallexample
@@ -27625,7 +28323,7 @@ For Body ("File_Queries.Insert") use "file_queries-insert-2005.ada";
 
 @noindent
 Note also that with project files it is desirable to use a different extension
-than @file{ads} / @file{adb} for alternativee versions. Otherwise a naming
+than @file{ads} / @file{adb} for alternative versions. Otherwise a naming
 conflict may arise through another commonly used feature: to declare as part
 of the project a set of directories containing all the sources obeying the
 default naming scheme.
@@ -27857,7 +28555,8 @@ from which it generates a sequence of assembly language instructions.
 
 The examples in this chapter will illustrate several of the forms
 for invoking @code{Asm}; a complete specification of the syntax
-is found in the @cite{GNAT Reference Manual}.
+is found in @ref{Machine Code Insertions,,, gnat_rm, GNAT Reference
+Manual}.
 
 Under the standard GNAT conventions, the @code{Nothing} procedure
 should be in a file named @file{nothing.adb}.
@@ -28055,7 +28754,7 @@ most useful (for the Intel x86 processor) are the following:
 @item =
 output constraint
 @item g
-global (i.e. can be stored anywhere)
+global (i.e.@: can be stored anywhere)
 @item m
 in memory
 @item I
@@ -28492,7 +29191,7 @@ following subsections treat the most likely issues to be encountered.
 @node Legal Ada 83 programs that are illegal in Ada 95
 @subsection Legal Ada 83 programs that are illegal in Ada 95
 
-Some legal Ada 83 programs are illegal (i.e. they will fail to compile) in
+Some legal Ada 83 programs are illegal (i.e., they will fail to compile) in
 Ada 95 and thus also in Ada 2005:
 
 @table @emph
@@ -28502,7 +29201,7 @@ Some uses of character literals are ambiguous.  Since Ada 95 has introduced
 character literals that were legal in Ada 83 are illegal in Ada 95.
 For example:
 @smallexample @c ada
-   for Char in 'A' .. 'Z' loop ... end loop;
+   for Char in 'A' .. 'Z' loop @dots{} end loop;
 @end smallexample
 
 @noindent
@@ -28510,7 +29209,7 @@ The problem is that @code{'A'} and @code{'Z'} could be from either
 @code{Character} or @code{Wide_Character}.  The simplest correction
 is to make the type explicit; e.g.:
 @smallexample @c ada
-   for Char in Character range 'A' .. 'Z' loop ... end loop;
+   for Char in Character range 'A' .. 'Z' loop @dots{} end loop;
 @end smallexample
 
 @item New reserved words
@@ -28737,11 +29436,11 @@ transition from certain Ada 83 compilers.
 @noindent
 Ada compilers are allowed to supplement the language-defined pragmas, and
 these are a potential source of non-portability.  All GNAT-defined pragmas
-are described in the GNAT Reference Manual, and these include several that
-are specifically intended to correspond to other vendors' Ada 83 pragmas.
+are described in @ref{Implementation Defined Pragmas,,, gnat_rm, GNAT
+Reference Manual}, and these include several that are specifically
+intended to correspond to other vendors' Ada 83 pragmas.
 For migrating from VADS, the pragma @code{Use_VADS_Size} may be useful.
-For
-compatibility with HP Ada 83, GNAT supplies the pragmas
+For compatibility with HP Ada 83, GNAT supplies the pragmas
 @code{Extend_System}, @code{Ident}, @code{Inline_Generic},
 @code{Interface_Name}, @code{Passive}, @code{Suppress_All},
 and @code{Volatile}.
@@ -28756,9 +29455,9 @@ relevant in a GNAT context and hence are not otherwise implemented.
 @subsection Implementation-defined attributes
 
 Analogous to pragmas, the set of attributes may be extended by an
-implementation.  All GNAT-defined attributes are described in the
-@cite{GNAT Reference Manual}, and these include several that are specifically
-intended
+implementation.  All GNAT-defined attributes are described in
+@ref{Implementation Defined Attributes,,, gnat_rm, GNAT Reference
+Manual}, and these include several that are specifically intended
 to correspond to other vendors' Ada 83 attributes.  For migrating from VADS,
 the attribute @code{VADS_Size} may be useful.  For compatibility with HP
 Ada 83, GNAT supplies the attributes @code{Bit}, @code{Machine_Size} and
@@ -28805,7 +29504,7 @@ ways to deal with this situation:
 
 @itemize @bullet
 @item
-Modify the program to eliminate the circularities, e.g. by moving
+Modify the program to eliminate the circularities, e.g.@: by moving
 elaboration-time code into explicitly-invoked procedures
 @item
 Constrain the elaboration order by including explicit @code{Elaborate_Body} or
@@ -29034,8 +29733,8 @@ Overview and Comparison on HP Platforms}.
 
 For GNAT running on other than VMS systems, all the HP Ada 83 pragmas and
 attributes are recognized, although only a subset of them can sensibly
-be implemented.  The description of pragmas in the
-@cite{GNAT Reference Manual}
+be implemented.  The description of pragmas in @ref{Implementation
+Defined Pragmas,,, gnat_rm, GNAT Reference Manual}
 indicates whether or not they are applicable to non-VMS systems.
 @end ifclear
 
@@ -29551,7 +30250,7 @@ uninstall or integrate different GNAT products.
 
 @noindent
 Make sure the system on which GNAT is installed is accessible from the
-current machine, i.e. the install location is shared over the network.
+current machine, i.e., the install location is shared over the network.
 Shared resources are accessed on Windows by means of UNC paths, which
 have the format @code{\\server\sharename\path}
 
@@ -29591,14 +30290,14 @@ $ gnatmake winprog -largs -mwindows
 
 @noindent
 It is possible to control where temporary files gets created by setting
-the TMP environment variable. The file will be created:
+the @env{TMP} environment variable. The file will be created:
 
 @itemize
-@item Under the directory pointed to by the TMP environment variable if
+@item Under the directory pointed to by the @env{TMP} environment variable if
 this directory exists.
 
-@item Under c:\temp, if the TMP environment variable is not set (or not
-pointing to a directory) and if this directory exists.
+@item Under @file{c:\temp}, if the @env{TMP} environment variable is not
+set (or not pointing to a directory) and if this directory exists.
 
 @item Under the current working directory otherwise.
 @end itemize
@@ -29622,7 +30321,7 @@ interoperability strategy.
 If you use @command{gcc} to compile the non-Ada part of your application,
 there are no Windows-specific restrictions that affect the overall
 interoperability with your Ada code. If you plan to use
-Microsoft tools (e.g. Microsoft Visual C/C++), you should be aware of
+Microsoft tools (e.g.@: Microsoft Visual C/C++), you should be aware of
 the following limitations:
 
 @itemize @bullet
@@ -29647,7 +30346,7 @@ of the above limitations, you have two choices:
 
 @enumerate
 @item
-Encapsulate your non Ada code in a DLL to be linked with your Ada
+Encapsulate your non-Ada code in a DLL to be linked with your Ada
 application. In this case, use the Microsoft or whatever environment to
 build the DLL and use GNAT to build your executable
 (@pxref{Using DLLs with GNAT}).
@@ -29828,7 +30527,7 @@ pragma Import (Stdcall, My_Var);
 
 @noindent
 Note that to ease building cross-platform bindings this convention
-will be handled as a @code{C} calling convention on non Windows platforms.
+will be handled as a @code{C} calling convention on non-Windows platforms.
 
 @node Win32 Calling Convention
 @subsection @code{Win32} Calling Convention
@@ -30071,7 +30770,7 @@ suffix) has the following structure:
 EXPORTS
    @i{symbol1}
    @i{symbol2}
-   ...
+   @dots{}
 @end cartouche
 @end group
 @end smallexample
@@ -30131,7 +30830,7 @@ to standard output the list of entry points in the DLL. Note that if
 some routines in the DLL have the @code{Stdcall} convention
 (@pxref{Windows Calling Conventions}) with stripped @code{@@}@i{nn}
 suffix then you'll have to edit @file{api.def} to add it, and specify
-@code{-k} to @code{gnatdll} when creating the import library.
+@option{-k} to @command{gnatdll} when creating the import library.
 
 @noindent
 Here are some hints to find the right @code{@@}@i{nn} suffix.
@@ -30228,11 +30927,11 @@ into the DLL. This is done by using the standard @command{gnatmake} tool.
 
 @item building the DLL
 
-To build the DLL you must use @command{gcc}'s @code{-shared}
+To build the DLL you must use @command{gcc}'s @option{-shared}
 option. It is quite simple to use this method:
 
 @smallexample
-$ gcc -shared -o api.dll obj1.o obj2.o ...
+$ gcc -shared -o api.dll obj1.o obj2.o @dots{}
 @end smallexample
 
 It is important to note that in this case all symbols found in the
@@ -30241,7 +30940,7 @@ the set of symbols to export by passing to @command{gcc} a definition
 file, @pxref{The Definition File}. For example:
 
 @smallexample
-$ gcc -shared -o api.dll api.def obj1.o obj2.o ...
+$ gcc -shared -o api.dll api.def obj1.o obj2.o @dots{}
 @end smallexample
 
 If you use a definition file you must export the elaboration procedures
@@ -30265,7 +30964,7 @@ $ attrib +R apilib\*.ali
 
 At this point it is possible to use the DLL by directly linking
 against it. Note that you must use the GNAT shared runtime when using
-GNAT shared libraries. This is achieved by using @code{-shared} binder's
+GNAT shared libraries. This is achieved by using @option{-shared} binder's
 option.
 
 @smallexample
@@ -30366,7 +31065,7 @@ one in the main program.
 
 It is therefore not possible to exchange GNAT run-time objects between the
 Ada DLL and the main Ada program. Example of GNAT run-time objects are file
-handles (e.g. @code{Text_IO.File_Type}), tasks types, protected objects
+handles (e.g.@: @code{Text_IO.File_Type}), tasks types, protected objects
 types, etc.
 
 It is completely safe to exchange plain elementary, array or record types,
@@ -30472,7 +31171,7 @@ package body API is
       return Fact;
    end Factorial;
 
-   ...
+   @dots{}
    --  The remainder of this package body is unchanged.
 end API;
 @end cartouche
@@ -30535,7 +31234,7 @@ during the DLL build process by the @code{gnatdll} tool
 
 @noindent
 To use the services exported by the Ada DLL from another programming
-language (e.g. C), you have to translate the specs of the exported Ada
+language (e.g.@: C), you have to translate the specs of the exported Ada
 entities in that language. For instance in the case of @code{API.dll},
 the corresponding C header file could look like:
 
@@ -30563,7 +31262,7 @@ example consider a DLL comprising the following package @code{API}:
 @cartouche
 package API is
    Count : Integer := 0;
-   ...
+   @dots{}
    --  Remainder of the package omitted.
 end API;
 @end cartouche
@@ -30669,7 +31368,7 @@ advise the reader to build relocatable DLL.
 @item -b @var{address}
 @cindex @option{-b} (@code{gnatdll})
 Set the relocatable DLL base address. By default the address is
-@var{0x11000000}.
+@code{0x11000000}.
 
 @item -bargs @var{opts}
 @cindex @option{-bargs} (@code{gnatdll})