-- dY Enable configurable run-time mode
-- dZ Generate listing showing the contents of the dispatch tables
- -- d.a
+ -- d.a Enable alignment promotion for non-scalar stand-alone objects
-- d.b
-- d.c
-- d.d
-- - In case of abstract subprograms the text "is abstract" is
-- added at the end of the line.
+ -- d.a Enable alignment promotion for non-VMS targets. On VMS, by default
+ -- (in Optimize_Alignment (Off) mode), the alignment of stand-alone
+ -- objects is increased in some cases to enable the generation of
+ -- better code. Use of this debug flag enables this transformation
+ -- on non-VMS targets.
+
-- d.f Suppress folding of static expressions. This of course results
-- in seriously non-conforming behavior, but is useful sometimes
-- when tracking down handling of complex expressions.
-- Documentation for gnatmake Debug Flags --
--------------------------------------------
+ -- df Only output file names, not path names, in log
+
-- dn Do not delete temporary files created by gnatmake at the end
-- of execution, such as temporary config pragma files, mapping
-- files or project path files.
@c o
@c G N A T _ RM o
@c o
-@c Copyright (C) 1995-2007, Free Software Foundation o
+@c Copyright (C) 1995-2008, Free Software Foundation o
@c o
@c o
@c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o
@end direntry
@copying
-Copyright @copyright{} 1995-2007, 2008 Free Software Foundation, Inc.
+Copyright @copyright{} 1995-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
* Pragma Assert::
* Pragma Ast_Entry::
* Pragma C_Pass_By_Copy::
+* Pragma Check::
* Pragma Check_Name::
+* Pragma Check_Policy::
* Pragma Comment::
* Pragma Common_Object::
* Pragma Compile_Time_Error::
* Pragma Passive::
* Pragma Persistent_BSS::
* Pragma Polling::
+* Pragma Postcondition::
+* Pragma Precondition::
* Pragma Profile (Ravenscar)::
* Pragma Profile (Restricted)::
* Pragma Psect_Object::
* Emax::
* Enabled::
* Enum_Rep::
+* Enum_Val::
* Epsilon::
* Fixed_Value::
* Has_Access_Values::
* Has_Discriminants::
* Img::
* Integer_Value::
+* Invalid_Value::
* Large::
* Machine_Size::
* Mantissa::
* GNAT.Table (g-table.ads)::
* GNAT.Task_Lock (g-tasloc.ads)::
* GNAT.Threads (g-thread.ads)::
+* GNAT.Time_Stamp (g-timsta.ads)::
* GNAT.Traceback (g-traceb.ads)::
* GNAT.Traceback.Symbolic (g-trasym.ads)::
* GNAT.UTF_32 (g-utf_32.ads)::
* Pragma Assert::
* Pragma Ast_Entry::
* Pragma C_Pass_By_Copy::
+* Pragma Check::
* Pragma Check_Name::
+* Pragma Check_Policy::
* Pragma Comment::
* Pragma Common_Object::
* Pragma Compile_Time_Error::
* Pragma Passive::
* Pragma Persistent_BSS::
* Pragma Polling::
+* Pragma Postcondition::
+* Pragma Precondition::
* Pragma Profile (Ravenscar)::
* Pragma Profile (Restricted)::
* Pragma Psect_Object::
@smallexample @c ada
pragma Assert (
boolean_EXPRESSION
- [, static_string_EXPRESSION]);
+ [, string_EXPRESSION]);
@end smallexample
@noindent
@code{Import} and @code{Export} pragmas, which allow specification of
passing mechanisms on a parameter by parameter basis.
+@node Pragma Check
+@unnumberedsec Pragma Check
+@cindex Assertions
+@cindex Named assertions
+@findex Check
+@noindent
+Syntax:
+@smallexample @c ada
+pragma Check (
+ [Name =>] Identifier,
+ [Check =>] Boolean_EXPRESSION
+ [, [Message =>] string_EXPRESSION] );
+@end smallexample
+
+@noindent
+This pragma is similar to the predefined pragma @code{Assert} except that an
+extra identifier argument is present. In conjunction with pragma
+@code{Check_Policy}, this can be used to define groups of assertions that can
+be independently controlled. The identifier @code{Assertion} is special, it
+refers to the normal set of pragma @code{Assert} statements. The identifiers
+@code{Precondition} and @code{Postcondition} correspond to the pragmas of these
+names, so these three names would normally not be used directly in a pragma
+@code{Check}.
+
+Checks introduced by this pragma are normally deactivated by default. They can
+be activated either by the command line option @option{-gnata}, which turns on
+all checks, or individually controlled using pragma @code{Check_Policy}.
+
@node Pragma Check_Name
@unnumberedsec Pragma Check_Name
@cindex Defining check names
This is a configuration pragma that defines a new implementation
defined check name (unless IDENTIFIER matches one of the predefined
check names, in which case the pragma has no effect). Check names
-are global to a partition, so if two more more configuration pragmas
+are global to a partition, so if two or more configuration pragmas
are present in a partition mentioning the same name, only one new
check name is introduced.
is part of the dependency set of the current unit (e.g., units that
are mentioned in @code{with} clauses).
+@node Pragma Check_Policy
+@unnumberedsec Pragma Check_Policy
+@cindex Controlling assertions
+@cindex Assertions, control
+@cindex Check pragma control
+@cindex Named assertions
+@findex Check
+@noindent
+Syntax:
+@smallexample @c ada
+pragma Check_Policy ([Name =>] Identifier, POLICY_IDENTIFIER);
+
+POLICY_IDENTIFIER ::= On | Off | Check | Ignore
+@end smallexample
+
+@noindent
+This pragma is similar to the predefined pragma @code{Assertion_Policy},
+except that it controls sets of named assertions introduced using the
+@code{Check} pragmas. It can be used as a configuration pragma or (unlike
+@code{Assertion_Policy}) can be used within a declarative part, in which case
+it controls the status to the end of the corresponding construct (in a manner
+identical to pragma @code{Suppress)}.
+
+The identifier given as the first argument corresponds to a name used in
+associated @code{Check} pragmas. For example, if the pragma:
+
+@smallexample @c ada
+pragma Check_Policy (Critical_Error, Off);
+@end smallexample
+
+@noindent
+is given, then subsequent @code{Check} pragmas whose first argument is also
+@code{Critical_Error} will be disabled. The special identifier @code{Assertion}
+controls the behavior of normal @code{Assert} pragmas (thus a pragma
+@code{Check_Policy} with this identifier is similar to the normal
+@code{Assertion_Policy} pragma except that it can appear within a
+declarative part).
+
+The special identifiers @code{Precondition} and @code{Postcondition} control
+the status of preconditions and postconditions. If a @code{Precondition} pragma
+is encountered, it is ignored if turned off by a @code{Check_Policy} specifying
+that @code{Precondition} checks are @code{Off} or @code{Ignored}. Similarly use
+of the name @code{Postcondition} controls whether @code{Postcondition} pragmas
+are recognized.
+
+The check policy is @code{Off} to turn off corresponding checks, and @code{On}
+to turn on corresponding checks. The default for a set of checks for which no
+@code{Check_Policy} is given is @code{Off} unless the compiler switch
+@option{-gnata} is given, which turns on all checks by default.
+
+The check policy settings @code{Check} and @code{Ignore} are also recognized
+as synonyms for @code{On} and @code{Off}. These synonyms are provided for
+compatibility with the standard @code{Assertion_Policy} pragma.
+
@node Pragma Comment
@unnumberedsec Pragma Comment
@findex Comment
Note that certain signals on many operating systems cannot be caught and
handled by applications. In such cases, the pragma is ignored. See the
operating system documentation, or the value of the array @code{Reserved}
-declared in the specification of package @code{System.OS_Interface}.
+declared in the spec of package @code{System.OS_Interface}.
Overriding the default state of signals used by the Ada runtime may interfere
with an application's runtime behavior in the cases of the synchronous signals,
that all units in a partition be compiled with a consistent setting of the
optimization setting. This would normally be achieved by use of a configuration
pragma file containing the appropriate setting. The exception to this rule is
-that predefined units in the GNAT library (that is, members of the Ada, System,
-Interfaces, GNAT hierarchies) ignore the setting of this pragma, and thus the
-consistency requirement does not apply to them.
+that units with an explicit configuration pragma in the same file as the source
+unit are excluded from the consistency check, as are all predefined units. The
+latter are commpiled by default in pragma Optimize_Alignment (Off) mode if no
+pragma appears at the start of the file.
@node Pragma Passive
@unnumberedsec Pragma Passive
@xref{Switches for gcc,,, gnat_ugn, @value{EDITION} User's Guide}, for
details.
+@node Pragma Postcondition
+@unnumberedsec Pragma Postcondition
+@cindex Postconditions
+@cindex Checks, postconditions
+@findex Postconditions
+@noindent
+Syntax:
+
+@smallexample @c ada
+pragma Postcondition (
+ [Check =>] Boolean_Expression
+ [,[Message =>] String_Expression]);
+@end smallexample
+
+@noindent
+The @code{Postcondition} pragma allows specification of automatic
+postcondition checks for subprograms. These checks are similar to
+assertions, but are automatically inserted just prior to the return
+statements of the subprogram with which they are associated.
+Furthermore, the boolean expression which is the condition which
+must be true may contain references to function'Result in the case
+of a function to refer to the returned value.
+
+@code{Postcondition} pragmas may appear either immediate following the
+(separate) declaration of a subprogram, or at the start of the
+declarations of a subprogram body. Only other pragmas may intervene
+(that is appear between the subprogram declaration and its
+postconditions, or appear before the postcondition in the
+declaration sequence in a subprogram body). In the case of a
+postcondition appearing after a subprogram declaration, the
+formal arguments of the subprogram are visible, and can be
+referenced in the postcondition expressions.
+
+The postconditions are collected and automatically tested just
+before any return (implicit or explicit) in the subprogram body.
+A postcondition is only recognized if postconditions are active
+at the time the pragma is encountered. The compiler switch @option{gnata}
+turns on all postconditions by default, and pragma @code{Check_Policy}
+with an identifier of @code{Postcondition} can also be used to
+control whether postconditions are active.
+
+The general approach is that postconditions are placed in the spec
+if they represent functional aspects which make sense to the client.
+For example we might have:
+
+@smallexample @c ada
+ function Direction return Integer;
+ pragma Postcondition
+ (Direction'Result = +1
+ or else
+ Direction'Result = -1);
+@end smallexample
+
+@noindent
+which serves to document that the result must be +1 or -1, and
+will test that this is the case at run time if postcondition
+checking is active.
+
+Postconditions within the subprogram body can be used to
+check that some internal aspect of the implementation,
+not visible to the client, is operating as expected.
+For instance if a square root routine keeps an internal
+counter of the number of times it is called, then we
+might have the following postcondition:
+
+@smallexample @c ada
+ Sqrt_Calls : Natural := 0;
+
+ function Sqrt (Arg : Float) return Float is
+ pragma Postcondition
+ (Sqrt_Calls = Sqrt_Calls'Old + 1);
+ ...
+ end Sqrt
+@end smallexample
+
+@noindent
+As this example, shows, the use of the @code{Old} attribute
+is often useful in postconditions to refer to the state on
+entry to the subprogram.
+
+Note that postconditions are only checked on normal returns
+from the subprogram. If an abnormal return results from
+raising an exception, then the postconditions are not checked.
+
+If a postcondition fails, then the exception
+@code{System.Assertions.Assert_Failure} is raised. If
+a message argument was supplied, then the given string
+will be used as the exception message. If no message
+argument was supplied, then the default message has
+the form "Postcondition failed at file:line". The
+exception is raised in the context of the subprogram
+body, so it is posssible to catch postcondition failures
+within the subprogram body itself.
+
+Within a package spec, normal visibility rules
+in Ada would prevent forward references within a
+postcondition pragma to functions defined later in
+the same package. This would introduce undesirable
+ordering constraints. To avoid this problem, all
+postcondition pragmas are analyzed at the end of
+the package spec, allowing forward references.
+
+The following example shows that this even allows
+mutually recursive postconditions as in:
+
+@smallexample @c ada
+package Parity_Functions is
+ function Odd (X : Natural) return Boolean;
+ pragma Postcondition
+ (Odd'Result =
+ (x = 1
+ or else
+ (x /= 0 and then Even (X - 1))));
+
+ function Even (X : Natural) return Boolean;
+ pragma Postcondition
+ (Even'Result =
+ (x = 0
+ or else
+ (x /= 1 and then Odd (X - 1))));
+
+end Parity_Functions;
+@end smallexample
+
+@noindent
+There are no restrictions on the complexity or form of
+conditions used within @code{Postcondition} pragmas.
+The following example shows that it is even possible
+to verify performance behavior.
+
+@smallexample @c ada
+package Sort is
+
+ Performance : constant Float;
+ -- Performance constant set by implementation
+ -- to match target architecture behavior.
+
+ procedure Treesort (Arg : String);
+ -- Sorts characters of argument using N*logN sort
+ pragma Postcondition
+ (Float (Clock - Clock'Old) <=
+ Float (Arg'Length) *
+ log (Float (Arg'Length)) *
+ Performance);
+end Sort;
+@end smallexample
+
+@node Pragma Precondition
+@unnumberedsec Pragma Precondition
+@cindex Preconditions
+@cindex Checks, preconditions
+@findex Preconditions
+@noindent
+Syntax:
+
+@smallexample @c ada
+pragma Precondition (
+ [Check =>] Boolean_Expression
+ [,[Message =>] String_Expression]);
+@end smallexample
+
+@noindent
+The @code{Precondition} pragma is similar to @code{Postcondition}
+except that the corresponding checks take place immediately upon
+entry to the subprogram, and if a precondition fails, the exception
+is raised in the context of the caller, and the attribute 'Result
+cannot be used within the precondition expression.
+
+Otherwise, the placement and visibility rules are identical to those
+described for postconditions. The following is an example of use
+within a package spec:
+
+@smallexample @c ada
+package Math_Functions is
+ ...
+ function Sqrt (Arg : Float) return Float;
+ pragma Precondition (Arg >= 0.0)
+ ...
+end Math_Functions;
+@end smallexample
+
+@code{Postcondition} pragmas may appear either immediate following the
+(separate) declaration of a subprogram, or at the start of the
+declarations of a subprogram body. Only other pragmas may intervene
+(that is appear between the subprogram declaration and its
+postconditions, or appear before the postcondition in the
+declaration sequence in a subprogram body).
+
@node Pragma Profile (Ravenscar)
@unnumberedsec Pragma Profile (Ravenscar)
@findex Ravenscar
aspects of tasking implementation, for example, the ability to map
tasks to specific processors. For details on the facilities available
for the version of GNAT that you are using, see the documentation
-in the specification of package System.Task_Info in the runtime
+in the spec of package System.Task_Info in the runtime
library.
@node Pragma Task_Name
a program can then handle the @code{SIGINT} interrupt as it chooses.
For a full list of the interrupts handled in a specific implementation,
-see the source code for the specification of @code{Ada.Interrupts.Names} in
+see the source code for the spec of @code{Ada.Interrupts.Names} in
file @file{a-intnam.ads}. This is a target dependent file that contains the
list of interrupts recognized for a given target. The documentation in
this file also specifies what interrupts are affected by the use of
is a pattern that is used to match against the text of individual
warning messages (not including the initial "warnings: " tag).
-The pattern may start with an asterisk, which matches otherwise unmatched
-characters at the start of the message, and it may also end with an asterisk
-which matches otherwise unmatched characters at the end of the message. For
-example, the string "*alignment*" could be used to match any warnings about
-alignment problems. Within the string, the sequence "*" can be used to match
-any sequence of characters enclosed in quotation marks. No other regular
+The pattern may contain asterisks which match zero or more characters in
+the message. For example, you can use
+@code{pragma Warnings (Off, "*bits of*unused")} to suppress the warning
+message @code{warning: 960 bits of "a" unused}. No other regular
expression notations are permitted. All characters other than asterisk in
these three specific cases are treated as literal characters in the match.
* Emax::
* Enabled::
* Enum_Rep::
+* Enum_Val::
* Epsilon::
* Fixed_Value::
* Has_Access_Values::
* Has_Discriminants::
* Img::
* Integer_Value::
+* Invalid_Value::
* Large::
* Machine_Size::
* Mantissa::
@noindent
This attribute can only be applied to a program unit name. It returns
the entity for the corresponding elaboration procedure for elaborating
-the specification of the referenced unit. This is used in the main
+the spec of the referenced unit. This is used in the main
generated elaboration procedure by the binder and is not normally used
in any other context. However, there may be specialized situations in
which it is useful to be able to call this elaboration procedure from
integer calculation is done at run time, then the call to @code{Enum_Rep}
may raise @code{Constraint_Error}.
+@node Enum_Val
+@unnumberedsec Enum_Val
+@cindex Representation of enums
+@findex Enum_Val
+@noindent
+For every enumeration subtype @var{S}, @code{@var{S}'Enum_Rep} denotes a
+function with the following spec:
+
+@smallexample @c ada
+function @var{S}'Enum_Rep (Arg : @i{Universal_Integer)
+ return @var{S}'Base};
+@end smallexample
+
+@noindent
+The function returns the enumeration value whose representation matches the
+argument, or raises Constraint_Error if no enumeration literal of the type
+has the matching value.
+This will be equal to value of the @code{Val} attribute in the
+absence of an enumeration representation clause. This is a static
+attribute (i.e.@: the result is static if the argument is static).
+
@node Epsilon
@unnumberedsec Epsilon
@cindex Ada 83 attributes
This attribute is primarily intended for use in implementation of the
standard input-output functions for fixed-point values.
+@node Invalid_Value
+@unnumberedsec Invalid_Value
+@findex Invalid_Value
+@noindent
+For every scalar type S, S'Invalid_Value returns an undefined value of the
+type. If possible this value is an invalid representation for the type. The
+value returned is identical to the value used to initialize an otherwise
+uninitialized value of the type if pragma Initialize_Scalars is used,
+including the ability to modify the value with the binder -Sxx flag and
+relevant environment variables at run time.
+
@node Large
@unnumberedsec Large
@cindex Ada 83 attributes
This restriction ensures at compile time that there is no implicit or
explicit dependence on the package @code{Ada.Calendar}.
+@item No_Default_Initialization
+@findex No_Default_Initialization
+
+This restriction prohibits any instance of default initialization of variables.
+The binder implements a consistency rule which prevents any unit compiled
+without the restriction from with'ing a unit with the restriction (this allows
+the generation of initialization procedures to be skipped, since you can be
+sure that no call is ever generated to an initialization procedure in a unit
+with the restriction active). If used in conjunction with Initialize_Scalars or
+Normalize_Scalars, the effect is to prohibit all cases of variables declared
+without a specific initializer (including the case of OUT scalar parameters).
+
@item No_Direct_Boolean_Operators
@findex No_Direct_Boolean_Operators
This restriction ensures that no logical (and/or/xor) or comparison
@end cartouche
@noindent
The string passed to @code{Linker_Options} is presented uninterpreted as
-an argument to the link command, unless it contains Ascii.NUL characters.
+an argument to the link command, unless it contains ASCII.NUL characters.
NUL characters if they appear act as argument separators, so for example
@smallexample @c ada
-pragma Linker_Options ("-labc" & ASCII.Nul & "-ldef");
+pragma Linker_Options ("-labc" & ASCII.NUL & "-ldef");
@end smallexample
@noindent
@item @emph{Records}.
For the normal non-packed case, the alignment of a record is equal to
the maximum alignment of any of its components. For tagged records, this
-includes the implicit access type used for the tag. If a pragma @code{Pack} is
-used and all fields are packable (see separate section on pragma @code{Pack}),
-then the resulting alignment is 1.
+includes the implicit access type used for the tag. If a pragma @code{Pack}
+is used and all components are packable (see separate section on pragma
+@code{Pack}), then the resulting alignment is 1, unless the layout of the
+record makes it profitable to increase it.
A special case is when:
@itemize @bullet
An alignment clause may specify a larger alignment than the default value
up to some maximum value dependent on the target (obtainable by using the
attribute reference @code{Standard'Maximum_Alignment}). It may also specify
-a smaller alignment than the default value, for example
+a smaller alignment than the default value for enumeration, integer and
+fixed point types, as well as for record types, for example
@smallexample @c ada
type V is record
of this subtype, and must be a multiple of the alignment value.
In addition, component size clauses are allowed which cause the array
-to be packed, by specifying a smaller value. The cases in which this
-is allowed are for component size values in the range 1 through 63. The value
-specified must not be smaller than the Size of the subtype. GNAT will
-accurately honor all packing requests in this range. For example, if
-we have:
+to be packed, by specifying a smaller value. A first case is for
+component size values in the range 1 through 63. The value specified
+must not be smaller than the Size of the subtype. GNAT will accurately
+honor all packing requests in this range. For example, if we have:
@smallexample @c ada
type r is array (1 .. 8) of Natural;
then the resulting array has a length of 31 bytes (248 bits = 8 * 31).
Of course access to the components of such an array is considerably
less efficient than if the natural component size of 32 is used.
+A second case is when the subtype of the component is a record type
+padded because of its default alignment. For example, if we have:
+
+@smallexample @c ada
+type r is record
+ i : Integer;
+ j : Integer;
+ b : Boolean;
+end record;
+
+type a is array (1 .. 8) of r;
+for a'Component_Size use 72;
+@end smallexample
+
+@noindent
+then the resulting array has a length of 72 bytes, instead of 96 bytes
+if the alignment of the record (4) was obeyed.
Note that there is no point in giving both a component size clause
and a pragma Pack for the same array type. if such duplicate
Any type whose size is specified with a size clause
@item
Any packed array type with a static size
+@item
+Any record type padded because of its default alignment
@end itemize
@noindent
* GNAT.Table (g-table.ads)::
* GNAT.Task_Lock (g-tasloc.ads)::
* GNAT.Threads (g-thread.ads)::
+* GNAT.Time_Stamp (g-timsta.ads)::
* GNAT.Traceback (g-traceb.ads)::
* GNAT.Traceback.Symbolic (g-trasym.ads)::
* GNAT.UTF_32 (g-utf_32.ads)::
single global task lock. Appropriate for use in situations where contention
between tasks is very rarely expected.
+@node GNAT.Time_Stamp (g-timsta.ads)
+@section @code{GNAT.Time_Stamp} (@file{g-timsta.ads})
+@cindex @code{GNAT.Time_Stamp} (@file{g-timsta.ads})
+@cindex Time stamp
+@cindex Current time
+
+@noindent
+Provides a simple function that returns a string YYYY-MM-DD HH:MM:SS.SS that
+represents the current date and time in ISO 8601 format. This is a very simple
+routine with minimal code and there are no dependencies on any other unit.
+
@node GNAT.Threads (g-thread.ads)
@section @code{GNAT.Threads} (@file{g-thread.ads})
@cindex @code{GNAT.Threads} (@file{g-thread.ads})
@smallexample
package_declaration ::=
- package_specification | package_renaming
+ package_spec | package_renaming
-package_specification ::=
+package_spec ::=
@b{package} package_identifier @b{is}
@{simple_declarative_item@}
@b{end} package_identifier ;
Improving Performance
* Performance Considerations::
+* Text_IO Suggestions::
* Reducing Size of Ada Executables with gnatelim::
* Reducing Size of Executables with unused subprogram/data elimination::
* Examples of gnatkr Usage::
Preprocessing Using gnatprep
+* Preprocessing Symbols::
* Using gnatprep::
* Switches for gnatprep::
* Form of Definitions File::
are ignored, and @option{-gnatn} and @option{-gnatN} have no
effect if this switch is present.
+@item -fno-inline-functions
+@cindex @option{-fno-inline-functions} (@command{gcc})
+Suppresses automatic inlining of small subprograms, which is enabled
+if @option{-O3} is used.
+
+@item -fno-inline-functions-called-once
+@cindex @option{-fno-inline-functions-called-once} (@command{gcc})
+Suppresses inlining of subprograms local to the unit and called once
+from within it, which is enabled if @option{-O1} is used.
+
@item -fno-strict-aliasing
@cindex @option{-fno-strict-aliasing} (@command{gcc})
Causes the compiler to avoid assumptions regarding non-aliasing
Assertions enabled. @code{Pragma Assert} and @code{pragma Debug} to be
activated. Note that these pragmas can also be controlled using the
configuration pragmas @code{Assertion_Policy} and @code{Debug_Policy}.
+It also activates pragmas @code{Check}, @code{Precondition}, and
+@code{Postcondition}. Note that these pragmas can also be controlled
+using the configuration pragma @code{Check_Policy}.
@item -gnatA
@cindex @option{-gnatA} (@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
to suppress (as though @option{-gnatws} had appeared at the start of
-the options.
+the options).
@end table
The warning string still appears, but the warning messages are counted
as errors, and prevent the generation of an object file.
+@item -gnatw.e
+@emph{Activate every optional warning}
+@cindex @option{-gnatw.e} (@command{gcc})
+@cindex Warnings, activate every optional warning
+This switch activates all optional warnings, including those which
+are not activated by @code{-gnatwa}.
+
@item -gnatwf
@emph{Activate warnings on unreferenced formals.}
@cindex @option{-gnatwf} (@command{gcc})
This switch disables warnings on variables that could be declared constants.
@item -gnatwl
-@emph{Activate warnings for missing elaboration pragmas.}
+@emph{Activate warnings for elaboration pragmas.}
@cindex @option{-gnatwl} (@command{gcc})
@cindex Elaboration, warnings
This switch activates warnings on missing
@code{Elaborate_All} and @code{Elaborate} pragmas.
See the section in this guide on elaboration checking for details on
-when such pragmas should be used. Warnings are also generated if you
+when such pragmas should be used. In dynamic elaboration mode, this switch
+generations warnings about the need to add elaboration pragmas. Note however,
+that if you blindly follow these warnings, and add @code{Elaborate_All}
+warnings wherever they are recommended, you basically end up with the
+equivalent of the static elaboration model, which may not be what you want for
+legacy code for which the static model does not work.
+
+For the static model, the messages generated are labeled "info:" (for
+information messages). They are not warnings to add elaboration pragmas,
+merely informational messages showing what implicit elaboration pragmas
+have been added, for use in analyzing elaboration circularity problems.
+
+Warnings are also generated if you
are using the static mode of elaboration, and a @code{pragma Elaborate}
is encountered. The default is that such warnings
are not generated.
This warning is not automatically turned on by the use of @option{-gnatwa}.
@item -gnatwL
-@emph{Suppress warnings for missing elaboration pragmas.}
+@emph{Suppress warnings for elaboration pragmas.}
@cindex @option{-gnatwL} (@command{gcc})
This switch suppresses warnings on missing Elaborate and Elaborate_All pragmas.
See the section in this guide on elaboration checking for details on
inlining mechanism cannot inline a call, it will simply ignore the
request silently.
+@item -gnatw.p
+@emph{Activate warnings on parameter ordering.}
+@cindex @option{-gnatw.p} (@command{gcc})
+@cindex Parameter order, warnings
+This switch activates warnings for cases of suspicious parameter
+ordering when the list of arguments are all simple identifiers that
+match the names of the formals, but are in a different order. The
+warning is suppressed if any use of named parameter notation is used,
+so this is the appropriate way to suppress a false positive (and
+serves to emphasize that the "misordering" is deliberate). The
+default is
+that such warnings are not given.
+This warning can also be turned on using @option{-gnatwa}.
+
+@item -gnatw.P
+@emph{Suppress warnings on parameter ordering.}
+@cindex @option{-gnatw.P} (@command{gcc})
+This switch suppresses warnings on cases of suspicious parameter
+ordering.
+
@item -gnatwq
@emph{Activate warnings on questionable missing parentheses.}
@cindex @option{-gnatwq} (@command{gcc})
where the types are known at compile time to have different
sizes or conventions.
+@item ^-Wunused^WARNINGS=UNUSED^
+@cindex @option{-Wunused}
+The warnings controlled by the @option{-gnatw} switch are generated by
+the front end of the compiler. The @option{GCC} back end can provide
+additional warnings and they are controlled by the @option{-W} switch.
+For example, @option{^-Wunused^WARNINGS=UNUSED^} activates back end
+warnings for entities that are declared but not referenced.
+
@item ^-Wuninitialized^WARNINGS=UNINITIALIZED^
@cindex @option{-Wuninitialized}
-The warnings controlled by the @option{-gnatw} switch are generated by the
-front end of the compiler. In some cases, the @option{^gcc^GCC^} back end
-can provide additional warnings. One such useful warning is provided by
-@option{^-Wuninitialized^WARNINGS=UNINITIALIZED^}. This must be used in
-conjunction with turning on optimization mode. This causes the flow
-analysis circuits of the back end optimizer to output additional
-warnings about uninitialized variables.
+Similarly, @option{^-Wuninitialized^WARNINGS=UNINITIALIZED^} activates
+the back end warning for uninitialized variables. This switch must be
+used in conjunction with an optimization level greater than zero.
+
+@item ^-Wall^/ALL_BACK_END_WARNINGS^
+@cindex @option{-Wall}
+This switch enables all the above warnings from the @option{GCC} back end.
+The code generator detects a number of warning situations that are missed
+by the @option{GNAT} front end, and this switch can be used to activate them.
+The use of this switch also sets the default front end warning mode to
+@option{-gnatwa}, that is, most front end warnings activated as well.
@item ^-w^/NO_BACK_END_WARNINGS^
@cindex @option{-w}
-This switch suppresses warnings from the @option{^gcc^GCC^} back end. The
-code generator detects a number of warning situations that are missed
-by the @option{GNAT} front end, and this switch can be used to suppress them.
+Conversely, this switch suppresses warnings from the @option{GCC} back end.
The use of this switch also sets the default front end warning mode to
@option{-gnatws}, that is, front end warnings suppressed as well.
@table @option
@c !sort!
-@item 1-9
+@item 0-9
@emph{Specify indentation level.}
If a digit from 1-9 appears
^in the string after @option{-gnaty}^as an option for /STYLE_CHECKS^
then proper indentation is checked, with the digit indicating the
-indentation level required.
+indentation level required. A value of zero turns off this style check.
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
@item ^a^ATTRIBUTE^
@emph{Check attribute casing.}
-If the ^letter a^word ATTRIBUTE^ appears in the string after @option{-gnaty}
-then attribute names, including the case of keywords such as @code{digits}
+Attribute names, including the case of keywords such as @code{digits}
used as attributes names, must be written in mixed case, that is, the
initial letter and any letter following an underscore must be uppercase.
All other letters must be lowercase.
@item ^A^ARRAY_INDEXES^
@emph{Use of array index numbers in array attributes.}
-If the ^letter A^word ARRAY_INDEXES^ appears in the string after
-@option{-gnaty} then when using the array attributes First, Last, Range,
+When using the array attributes First, Last, Range,
or Length, the index number must be omitted for one-dimensional arrays
and is required for multi-dimensional arrays.
@item ^b^BLANKS^
@emph{Blanks not allowed at statement end.}
-If the ^letter b^word BLANKS^ appears in the string after @option{-gnaty} then
-trailing blanks are not allowed at the end of statements. The purpose of this
+Trailing blanks are not allowed at the end of statements. The purpose of this
rule, together with h (no horizontal tabs), is to enforce a canonical format
for the use of blanks to separate source tokens.
@item ^c^COMMENTS^
@emph{Check comments.}
-If the ^letter c^word COMMENTS^ appears in the string after @option{-gnaty}
-then comments must meet the following set of rules:
+Comments must meet the following set of rules:
@itemize @bullet
@item ^d^DOS_LINE_ENDINGS^
@emph{Check no DOS line terminators present.}
-If the ^letter d^word DOS_LINE_ENDINGS^ appears in the string after
-@option{-gnaty} then all lines must be terminated by a single ASCII.LF
+All lines must be terminated by a single ASCII.LF
character (in particular the DOS line terminator sequence CR/LF is not
allowed).
@item ^e^END^
@emph{Check end/exit labels.}
-If the ^letter e^word END^ appears in the string after @option{-gnaty} then
-optional labels on @code{end} statements ending subprograms and on
+Optional labels on @code{end} statements ending subprograms and on
@code{exit} statements exiting named loops, are required to be present.
@item ^f^VTABS^
@emph{No form feeds or vertical tabs.}
-If the ^letter f^word VTABS^ appears in the string after @option{-gnaty} then
-neither form feeds nor vertical tab characters are permitted
+Neither form feeds nor vertical tab characters are permitted
in the source text.
@item ^g^GNAT^
@emph{GNAT style mode}
-If the ^letter g^word GNAT^ appears in the string after @option{-gnaty} then
-the set of style check switches is set to match that used by the GNAT sources.
+The set of style check switches is set to match that used by the GNAT sources.
This may be useful when developing code that is eventually intended to be
incorporated into GNAT. For further details, see GNAT sources.
@item ^h^HTABS^
@emph{No horizontal tabs.}
-If the ^letter h^word HTABS^ appears in the string after @option{-gnaty} then
-horizontal tab characters are not permitted in the source text.
+Horizontal tab characters are not permitted in the source text.
Together with the b (no blanks at end of line) check, this
enforces a canonical form for the use of blanks to separate
source tokens.
@item ^i^IF_THEN^
@emph{Check if-then layout.}
-If the ^letter i^word IF_THEN^ appears in the string after @option{-gnaty},
-then the keyword @code{then} must appear either on the same
+The keyword @code{then} must appear either on the same
line as corresponding @code{if}, or on a line on its own, lined
up under the @code{if} with at least one non-blank line in between
containing all or part of the condition to be tested.
@item ^I^IN_MODE^
@emph{check mode IN keywords}
-If the ^letter I (upper case)^word IN_MODE^ appears in the string
-after @option{-gnaty} then mode @code{in} (the default mode) is not
+Mode @code{in} (the default mode) is not
allowed to be given explicitly. @code{in out} is fine,
but not @code{in} on its own.
@item ^k^KEYWORD^
@emph{Check keyword casing.}
-If the ^letter k^word KEYWORD^ appears in the string after @option{-gnaty} then
-all keywords must be in lower case (with the exception of keywords
+All keywords must be in lower case (with the exception of keywords
such as @code{digits} used as attribute names to which this check
does not apply).
@item ^l^LAYOUT^
@emph{Check layout.}
-If the ^letter l^word LAYOUT^ appears in the string after @option{-gnaty} then
-layout of statement and declaration constructs must follow the
+Layout of statement and declaration constructs must follow the
recommendations in the Ada Reference Manual, as indicated by the
form of the syntax rules. For example an @code{else} keyword must
be lined up with the corresponding @code{if} keyword.
@item ^Lnnn^MAX_NESTING=nnn^
@emph{Set maximum nesting level}
-If the sequence ^Lnnn^MAX_NESTING=nnn^, where nnn is a decimal number in
-the range 0-999, appears in the string after @option{-gnaty} then the
-maximum level of nesting of constructs (including subprograms, loops,
-blocks, packages, and conditionals) may not exceed the given value. A
-value of zero disconnects this style check.
+The maximum level of nesting of constructs (including subprograms, loops,
+blocks, packages, and conditionals) may not exceed the given value
+@option{nnn}. A value of zero disconnects this style check.
@item ^m^LINE_LENGTH^
@emph{Check maximum line length.}
-If the ^letter m^word LINE_LENGTH^ appears in the string after @option{-gnaty}
-then the length of source lines must not exceed 79 characters, including
+The length of source lines must not exceed 79 characters, including
any trailing blanks. The value of 79 allows convenient display on an
80 character wide device or window, allowing for possible special
treatment of 80 character lines. Note that this count is of
@item ^Mnnn^MAX_LENGTH=nnn^
@emph{Set maximum line length.}
-If the sequence ^M^MAX_LENGTH=^nnn, where nnn is a decimal number, appears in
-the string after @option{-gnaty} then the length of lines must not exceed the
-given value. The maximum value that can be specified is 32767.
+The length of lines must not exceed the
+given value @option{nnn}. The maximum value that can be specified is 32767.
@item ^n^STANDARD_CASING^
@emph{Check casing of entities in Standard.}
-If the ^letter n^word STANDARD_CASING^ appears in the string
-after @option{-gnaty} then any identifier from Standard must be cased
+Any identifier from Standard must be cased
to match the presentation in the Ada Reference Manual (for example,
@code{Integer} and @code{ASCII.NUL}).
+@item ^N^NONE^
+@emph{Turn off all style checks}
+All style check options are turned off.
+
@item ^o^ORDERED_SUBPROGRAMS^
@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
+All subprogram bodies in a given scope
(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
@item ^p^PRAGMA^
@emph{Check pragma casing.}
-If the ^letter p^word PRAGMA^ appears in the string after @option{-gnaty} then
-pragma names must be written in mixed case, that is, the
+Pragma names must be written in mixed case, that is, the
initial letter and any letter following an underscore must be uppercase.
All other letters must be lowercase.
@item ^r^REFERENCES^
@emph{Check references.}
-If the ^letter r^word REFERENCES^ appears in the string after @option{-gnaty}
-then all identifier references must be cased in the same way as the
+All identifier references must be cased in the same way as the
corresponding declaration. No specific casing style is imposed on
identifiers. The only requirement is for consistency of references
with declarations.
@item ^S^STATEMENTS_AFTER_THEN_ELSE^
@emph{Check no statements after THEN/ELSE.}
-If the ^letter S^word STATEMENTS_AFTER_THEN_ELSE^ appears in the
-string after @option{-gnaty} then it is not permitted to write any
-statements on the same line as a THEN OR ELSE keyword following the
+No statements are allowed
+on the same line as a THEN OR ELSE keyword following the
keyword in an IF statement. OR ELSE and AND THEN are not affected,
and a special exception allows a pragma to appear after ELSE.
@item ^s^SPECS^
@emph{Check separate specs.}
-If the ^letter s^word SPECS^ appears in the string after @option{-gnaty} then
-separate declarations (``specs'') are required for subprograms (a
+Separate declarations (``specs'') are required for subprograms (a
body is not allowed to serve as its own declaration). The only
exception is that parameterless library level procedures are
not required to have a separate declaration. This exception covers
@item ^t^TOKEN^
@emph{Check token spacing.}
-If the ^letter t^word TOKEN^ appears in the string after @option{-gnaty} then
-the following token spacing rules are enforced:
+The following token spacing rules are enforced:
@itemize @bullet
@item ^u^UNNECESSARY_BLANK_LINES^
@emph{Check unnecessary blank lines.}
-Check for unnecessary blank lines. A blank line is considered
+Unnecessary blank lines are not allowed. A blank line is considered
unnecessary if it appears at the end of the file, or if more than
one blank line occurs in sequence.
@item ^x^XTRA_PARENS^
@emph{Check extra parentheses.}
-Check for the use of an unnecessary extra level of parentheses (C-style)
+Unnecessary extra level of parentheses (C-style) are not allowed
around conditions in @code{if} statements, @code{while} statements and
@code{exit} statements.
+@item ^y^ALL_BUILTIN^
+@emph{Set all standard style check options}
+This is equivalent to @code{gnaty3aAbcefhiklmnprst}, that is all checking
+options enabled with the exception of @option{-gnatyo},
+@option{-gnatyd}, @option{-gnatyu}, and @option{-gnatyx}.
+
+@ifclear vms
+@item -
+@emph{Remove style check options}
+This causes any subsequent options in the string to act as canceling the
+corresponding style check option.
+
+@item +
+This causes any subsequent options in the string to enable the corresponding
+style check option. It only has an effect if a previous ^-^REMOVE^ has been
+encountered.
+@end ifclear
+
+@ifset vms
+@item NOxxx
+@emph{Removing style check options}
+If the name of a style check is preceded by @option{NO} then the corresponding
+style check is turned off. For example @option{NOCOMMENTS} turns off style
+checking for comments.
+@end ifset
@end table
@noindent
The switch
@ifclear vms
@option{-gnaty} on its own (that is not
-followed by any letters or digits),
-is equivalent to @code{gnaty3aAbcefhiklmnprst}, that is all checking
-options enabled with the exception of @option{-gnatyo},
-@option{-gnatyd}, @option{-gnatyu}, and @option{-gnatyx}.
+followed by any letters or digits), then the effect is equivalent
+to the use of @option{-gnatyy}, as described above, that is all
+built-in standard style check options are enabled.
+
@end ifclear
@ifset vms
/STYLE_CHECKS=ALL_BUILTIN enables all checking options with
(such as dividing 0.0 by 0.0).
The reason that we distinguish overflow checking from other kinds of
-range constraint checking is that a failure of an overflow check can
-generate an incorrect value, but cannot cause erroneous behavior. This
-is unlike the situation with a constraint check on an array subscript,
-where failure to perform the check can result in random memory description,
-or the range check on a case statement, where failure to perform the check
-can cause a wild jump.
+range constraint checking is that a failure of an overflow check, unlike
+for example the failure of a range check, can result in an incorrect
+value, but cannot cause random memory destruction (like an out of range
+subscript), or a wild jump (from an out of range case value). Overflow
+checking is also quite expensive in time and space, since in general it
+requires the use of double length arithmetic.
Note again that @option{-gnato} is off by default, so overflow checking is
not performed in default mode. This means that out of the box, with the
easily understood by an Ada programmer. The following special syntactic
additions correspond to low level features used in the generated code that
do not have any exact analogies in pure Ada source form. The following
-is a partial list of these special constructions. See the specification
+is a partial list of these special constructions. See the spec
of package @code{Sprint} in file @file{sprint.ads} for a full list.
If the switch @option{-gnatL} is used in conjunction with
A mapping file is a sequence of sets of three lines. In each set,
the first line is the unit name, in lower case, with ``@code{%s}''
appended for
-specifications and ``@code{%b}'' appended for bodies; the second line is the
+specs and ``@code{%b}'' appended for bodies; the second line is the
file name; and the third line is the path name.
Example:
Using @var{linker options} it is possible to set the program stack and
heap size.
-@ifclear vms
+@ifset unw
See @ref{Setting Stack Size from gnatlink} and
@ref{Setting Heap Size from gnatlink}.
-@end ifclear
+@end ifset
@command{gnatlink} determines the list of objects required by the Ada
program and prepends them to the list of objects passed to the linker.
File may be compile. When this switch is used, a source outside of all Project
Files may be compiled. The ALI file and the object file will be put in the
object directory of the main Project. The compilation switches used will only
-be those specified on the command line.
+be those specified on the command line. Even when
+@option{^-x^/NON_PROJECT_UNIT_COMPILATION^} is used, mains specified on the
+command line need to be sources of a project file.
@item ^-X^/EXTERNAL_REFERENCE=^@var{name=value}
Indicate that external variable @var{name} has the value @var{value}.
@ifnottex
@menu
* Performance Considerations::
+* Text_IO Suggestions::
* Reducing Size of Ada Executables with gnatelim::
* Reducing Size of Executables with unused subprogram/data elimination::
@end menu
@subsection Optimization Levels
@cindex @option{^-O^/OPTIMIZE^} (@command{gcc})
+@noindent
+Without any optimization ^option,^qualifier,^
+the compiler's goal is to reduce the cost of
+compilation and to make debugging produce the expected results.
+Statements are independent: if you stop the program with a breakpoint between
+statements, you can then assign a new value to any variable or change
+the program counter to any other statement in the subprogram and get exactly
+the results you would expect from the source code.
+
+Turning on optimization makes the compiler attempt to improve the
+performance and/or code size at the expense of compilation time and
+possibly the ability to debug the program.
+
+If you use multiple
+^-O options, with or without level numbers,^/OPTIMIZE qualifiers,^
+the last such option is the one that is effective.
+
@noindent
The default is optimization off. This results in the fastest compile
times, but GNAT makes absolutely no attempt to optimize, and the
the fastest compilation time.
Note that many other compilers do fairly extensive optimization
-even if "no optimization" is specified. When using gcc, it is
+even if ``no optimization'' is specified. With gcc, it is
very unusual to use ^-O0^/OPTIMIZE=NONE^ for production if
execution time is of any concern, since ^-O0^/OPTIMIZE=NONE^
really does mean no optimization at all. This difference between
both depend on the particular application and the hardware environment.
You should experiment to find the best level for your application.
-The @option{^-Os^/OPTIMIZE=SPACE^} switch is independent of the time
-optimizations, so you can specify both @option{^-Os^/OPTIMIZE=SPACE^}
-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.
@item
The called subprogram is suitable for inlining: It must be small enough
-and not contain nested subprograms or anything else that @command{gcc}
-cannot support in inlined subprograms.
-
-@item
-The call occurs after the definition of the body of the subprogram.
+and not contain something that @command{gcc} cannot support in inlined
+subprograms.
@item
@cindex pragma Inline
@findex Inline
-Either @code{pragma Inline} applies to the subprogram or it is
-small and automatic inlining (optimization level @option{-O3}) is
-specified.
+Either @code{pragma Inline} applies to the subprogram, or it is local
+to the unit and called once from within it, or it is small and automatic
+inlining (optimization level @option{-O3}) is specified.
@end itemize
@noindent
@item
The called subprogram is suitable for inlining: It must be small enough
-and not contain nested subprograms or anything else @command{gcc} cannot
-support in inlined subprograms.
+and not contain something that @command{gcc} cannot support in inlined
+subprograms.
@item
The call appears in a body (not in a package spec).
@option{-gnatn} will still be active, even if
this switch is used to suppress the resulting inlining actions.
+@cindex @option{-fno-inline-functions} (@command{gcc})
+Note: The @option{-fno-inline-functions} switch can be used to prevent
+automatic inlining of small subprograms if @option{-O3} is used.
+
+@cindex @option{-fno-inline-functions-called-once} (@command{gcc})
+Note: The @option{-fno-inline-functions-called-once} switch
+can be used to prevent inlining of subprograms local to the unit
+and called once from within it if @option{-O1} is used.
+
Note regarding the use of @option{-O3}: There is no difference in inlining
behavior between @option{-O2} and @option{-O3} for subprograms with an explicit
pragma @code{Inline} assuming the use of @option{-gnatn}
@pxref{Profiling} for details of usage.
@end ifset
+
+@node Text_IO Suggestions
+@section @code{Text_IO} Suggestions
+@cindex @code{Text_IO} and performance
+
+@noindent
+The @code{Ada.Text_IO} package has fairly high overheads due in part to
+the requirement of maintaining page and line counts. If performance
+is critical, a recommendation is to use @code{Stream_IO} instead of
+@code{Text_IO} for volume output, since this package has less overhead.
+
+If @code{Text_IO} must be used, note that by default output to the standard
+output and standard error files is unbuffered (this provides better
+behavior when output statements are used for debugging, or if the
+progress of a program is observed by tracking the output, e.g. by
+using the Unix @command{tail -f} command to watch redirected output.
+
+If you are generating large volumes of output with @code{Text_IO} and
+performance is an important factor, use a designated file instead
+of the standard output file, or change the standard output file to
+be buffered using @code{Interfaces.C_Streams.setvbuf}.
+
+
+
@node Reducing Size of Ada Executables with gnatelim
@section Reducing Size of Ada Executables with @code{gnatelim}
@findex gnatelim
Ada_83
Ada_95
Ada_05
+ Ada_2005
+ Assertion_Policy
C_Pass_By_Copy
+ Check_Name
+ Check_Policy
+ Compile_Time_Error
+ Compile_Time_Warning
+ Compiler_Unit
Component_Alignment
+ Debug_Policy
Detect_Blocking
Discard_Names
Elaboration_Checks
Eliminate
Extend_System
External_Name_Casing
+ Fast_Math
+ Favor_Top_Level
Float_Representation
+ Implicit_Packing
Initialize_Scalars
Interrupt_State
License
Locking_Policy
Long_Float
+ No_Run_Time
+ No_Strict_Aliasing
Normalize_Scalars
+ Optimize_Alignment
Persistent_BSS
Polling
+ Priority_Specific_Dispatching
Profile
Profile_Warnings
Propagate_Exceptions
Restrictions_Warnings
Reviewable
Source_File_Name
+ Source_File_Name_Project
Style_Checks
Suppress
+ Suppress_Exception_Locations
Task_Dispatching_Policy
Universal_Data
Unsuppress
Use_VADS_Size
- Warnings
Validity_Checks
+ Warnings
+ Wide_Character_Encoding
+
@end smallexample
@menu
@noindent
In large software systems it is common to have multiple
implementations of a common interface; in Ada terms, multiple versions of a
-package body for the same specification. For example, one implementation
+package body for the same spec. For example, one implementation
might be safe for use in tasking programs, while another might only be used
in sequential applications. This can be modeled in GNAT using the concept
of @emph{project extension}. If one project (the ``child'') @emph{extends}
An inherited source file retains any switches specified in the parent project.
-For example if the project @code{Utilities} contains the specification and the
+For example if the project @code{Utilities} contains the spec and the
body of an Ada package @code{Util_IO}, then the project
@code{Modified_Utilities} can contain a new body for package @code{Util_IO}.
The original body of @code{Util_IO} will not be considered in program builds.
-However, the package specification will still be found in the project
+However, the package spec will still be found in the project
@code{Utilities}.
A child project can have only one parent but it may import any number of other
@table @option
@item ^-P^/PROJECT_FILE=^@var{project}
-@cindex @option{^-P^/PROJECT_FILE^} (any tool supporting project files)
+@cindex @option{^-P^/PROJECT_FILE^} (any project-aware tool)
Indicates the name of a project file. This project file will be parsed with
the verbosity indicated by @option{^-vP^MESSAGE_PROJECT_FILES=^@emph{x}},
if any, and using the external references indicated
or @option{^-X^/EXTERNAL_REFERENCE^} is not significant.
@item ^-X^/EXTERNAL_REFERENCE=^@var{name=value}
-@cindex @option{^-X^/EXTERNAL_REFERENCE^} (any tool supporting project files)
+@cindex @option{^-X^/EXTERNAL_REFERENCE^} (any project-aware tool)
Indicates that external variable @var{name} has the value @var{value}.
The Project Manager will use this value for occurrences of
@code{external(name)} when parsing the project file.
takes precedence over the value of the same name in the environment.
@item ^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}
-@cindex @code{^-vP^/MESSAGES_PROJECT_FILE^} (any tool supporting project files)
-@c Previous line uses code vs option command, to stay less than 80 chars
+@cindex @option{^-vP^/MESSAGES_PROJECT_FILE^} (any project-aware tool)
Indicates the verbosity of the parsing of GNAT project files.
@ifclear vms
If several @option{^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}} switches are present,
only the last one is used.
+@item ^-aP^/ADD_PROJECT_SEARCH_DIR=^<dir>
+@cindex @option{^-aP^/ADD_PROJECT_SEARCH_DIR=^} (any project-aware tool)
+Add directory <dir> at the beginning of the project search path, in order,
+after the current working directory.
+
+@ifclear vms
+@item -eL
+@cindex @option{-eL} (any project-aware tool)
+Follow all symbolic links when processing project files.
+@end ifclear
+
+@item ^--subdirs^/SUBDIRS^=<subdir>
+@cindex @option{^--subdirs^/SUBDIRS^=} (gnatmake and gnatclean)
+This switch is recognized by gnatmake and gnatclean. It indicate that the real
+directories (except the source directories) are the subdirectories <subdir>
+of the directories specified in the project files. This applies in particular
+to object directories, library directories and exec directories. If the
+subdirectories do not exist, they are created automatically.
+
@end table
@c **********************************
other_declarative_item
package_declaration ::=
- package_specification | package_renaming
+ package_spec | package_renaming
-package_specification ::=
+package_spec ::=
@b{package} package_identifier @b{is}
@{simple_declarative_item@}
@b{end} package_identifier ;
@cindex @option{^--no-separate-is^/NO_SEPARATE_IS^} (@command{gnatpp})
@item ^--no-separate-is^/NO_SEPARATE_IS^
Do not place the keyword @code{is} on a separate line in a subprogram body in
-case if the specification occupies more then one line.
+case if the spec occupies more then one line.
@cindex @option{^--separate-loop-then^/SEPARATE_LOOP_THEN^} (@command{gnatpp})
@item ^--separate-loop-then^/SEPARATE_LOOP_THEN^
Like @option{^-r^/REPLACE^} except that if the file with the specified name
already exists, it is overwritten.
-@item ^-rnb^/NO_BACKUP^
-@cindex @option{^-rnb^/NO_BACKUP^} (@code{gnatpp})
+@item ^-rnb^/REPLACE_NO_BACKUP^
+@cindex @option{^-rnb^/REPLACE_NO_BACKUP^} (@code{gnatpp})
Replace the input source file with the reformatted output without
creating any backup copy of the input source.
subprogram (and generic subprogram) bodies;
@item
-package (and generic package) specifications and bodies;
+package (and generic package) specs and bodies;
@item
task object and type specifications and bodies;
* Line Metrics Control::
* Syntax Metrics Control::
* Complexity Metrics Control::
+* Object-Oriented Metrics Control::
@end menu
@node Line Metrics Control
@table @emph
@item Public subprograms
-This metric is computed for package specifications. It is the
+This metric is computed for package specs. It is the
number of subprograms and generic subprograms declared in the visible
part (including the visible part of nested packages, protected objects, and
protected types).
subprograms are counted in the same way as ``usual'' subprogram bodies.
@item Public types
-This metric is computed for package specifications and
+This metric is computed for package specs 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
@cindex @option{^--syntax@var{x}^/SYNTAX_METRICS^} (@command{gnatmetric})
@ifclear vms
-@cindex @option{--no-syntax@var{x}}
+@cindex @option{--no-syntax@var{x}} (@command{gnatmetric})
@end ifclear
@item ^--syntax-all^/SYNTAX_METRICS=ALL_ON^
@end table
+
+@node Object-Oriented Metrics Control
+@subsubsection Object-Oriented Metrics Control
+@cindex Object-Oriented metrics control in @command{gnatmetric}
+
+@noindent
+@cindex Coupling metrics (in in @command{gnatmetric})
+Coupling metrics are object-oriented metrics that measure the
+dependencies between a given class (or a group of classes) and the
+``external world'' (that is, the other classes in the program). In this
+subsection the term ``class'' is used in its
+traditional object-oriented programming sense
+(an instantiable module that contains data and/or method members).
+A @emph{category} (of classes)
+is a group of closely related classes that are reused and/or
+modified together.
+
+A class @code{K}'s @emph{efferent coupling} is the number of classes
+that @code{K} depends upon.
+A category's efferent coupling is the number of classes outside the
+category that the classes inside the category depend upon.
+
+A class @code{K}'s @emph{afferent coupling} is the number of classes
+that depend upon @code{K}.
+A category's afferent coupling is the number of classes outside the
+category that depend on classes belonging to the category.
+
+Ada's implementation of the object-oriented paradigm does not use the
+traditional class notion, so the definition of the coupling
+metrics for Ada maps the class and class category notions
+onto Ada constructs.
+
+For the coupling metrics, several kinds of modules -- a library package,
+a library generic package, and a library generic package instantiation --
+that define a tagged type or an interface type are
+considered to be a class. A category consists of a library package (or
+a library generic package) that defines a tagged or an interface type,
+together with all its descendant (generic) packages that define tagged
+or interface types. For any package counted as a class,
+its body (if any) is considered
+together with its spec when counting the dependencies. For dependencies
+between classes, the Ada semantic dependencies are considered.
+For coupling metrics, only dependencies on units that are considered as
+classes, are considered.
+
+When computing coupling metrics, @command{gnatmetric} counts only
+dependencies between units that are arguments of the gnatmetric call.
+Coupling metrics are program-wide (or project-wide) metrics, so to
+get a valid result, you should call @command{gnatmetric} for
+the whole set of sources that make up your program. It can be done
+by calling @command{gnatmetric} from the GNAT driver with @option{-U}
+option (see See @ref{The GNAT Driver and Project Files} for details.
+
+By default, all the coupling metrics are disabled. You can use the following
+switches to specify the coupling metrics to be computed and reported:
+
+@table @option
+
+@ifclear vms
+@cindex @option{--package@var{x}} (@command{gnatmetric})
+@cindex @option{--no-package@var{x}} (@command{gnatmetric})
+@cindex @option{--category@var{x}} (@command{gnatmetric})
+@cindex @option{--no-category@var{x}} (@command{gnatmetric})
+@end ifclear
+
+@ifset vms
+@cindex @option{/COUPLING_METRICS} (@command{gnatmetric})
+@end ifset
+
+@item ^--coupling-all^/COUPLING_METRICS=ALL_ON^
+Report all the coupling metrics
+
+@item ^--no-coupling-all^/COUPLING_METRICS=ALL_OFF^
+Do not report any of metrics
+
+@item ^--package-efferent-coupling^/COUPLING_METRICS=PACKAGE_EFFERENT_ON^
+Report package efferent coupling
+
+@item ^--no-package-efferent-coupling^/COUPLING_METRICS=PACKAGE_EFFERENT_OFF^
+Do not report package efferent coupling
+
+@item ^--package-afferent-coupling^/COUPLING_METRICS=PACKAGE_AFFERENT_ON^
+Report package afferent coupling
+
+@item ^--no-package-afferent-coupling^/COUPLING_METRICS=PACKAGE_AFFERENT_OFF^
+Do not report package afferent coupling
+
+@item ^--category-efferent-coupling^/COUPLING_METRICS=CATEGORY_EFFERENT_ON^
+Report category efferent coupling
+
+@item ^--no-category-efferent-coupling^/COUPLING_METRICS=CATEGORY_EFFERENT_OFF^
+Do not report category efferent coupling
+
+@item ^--category-afferent-coupling^/COUPLING_METRICS=CATEGORY_AFFERENT_ON^
+Report category afferent coupling
+
+@item ^--no-category-afferent-coupling^/COUPLING_METRICS=CATEGORY_AFFERENT_OFF^
+Do not report category afferent coupling
+
+@end table
+
@node Other gnatmetric Switches
@subsection Other @code{gnatmetric} Switches
replaced by a ^tilde^dollar sign^ if the first character is
^@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.
+spec and @code{.adb} for a body.
Krunching does not affect the extension, but the file name is shortened to
the specified length by following these rules:
@ref{Conditional Compilation}.
@menu
+* Preprocessing Symbols::
* Using gnatprep::
* Switches for gnatprep::
* Form of Definitions File::
* Form of Input Text for gnatprep::
@end menu
+@node Preprocessing Symbols
+@section Preprocessing Symbols
+
+@noindent
+Preprocessing symbols are defined in definition files and referred to in
+sources to be preprocessed. A Preprocessing symbol is an identifier, following
+normal Ada (case-insensitive) rules for its syntax, with the restriction that
+all characters need to be in the ASCII set (no accented letters).
@node Using gnatprep
@section Using @code{gnatprep}
@item deffile
is the full name of a text file containing definitions of
-symbols to be referenced by the preprocessor. This argument is
+preprocessing symbols to be referenced by the preprocessor. This argument is
optional, and can be replaced by the use of the @option{-D} switch.
@end table
@item ^-Dsymbol=value^/ASSOCIATE="symbol=value"^
@cindex @option{^-D^/ASSOCIATE^} (@command{gnatprep})
-Defines a new symbol, associated with value. If no value is given on the
-command line, then symbol is considered to be @code{True}. This switch
+Defines a new preprocessing symbol, associated with value. If no value is given
+on the command line, then symbol is considered to be @code{True}. This switch
can be used in place of a definition file.
@ifset vms
@end smallexample
@noindent
-where symbol is an identifier, following normal Ada (case-insensitive)
-rules for its syntax, and value is one of the following:
+where symbol is a preprocessing symbol, and value is one of the following:
@itemize @bullet
@item
@ignore
* Improperly_Called_Protected_Entries::
@end ignore
+* Metrics_Violation::
* Misnamed_Identifiers::
* Multiple_Entries_In_Protected_Definitions::
* Name_Clashes::
@cindex @code{Improperly_Located_Instantiations} rule (for @command{gnatcheck})
@noindent
-Flag all generic instantiations in library-level package specifications
+Flag all generic instantiations in library-level package specs
(including library generic packages) and in all subprogram bodies.
Instantiations in task and entry bodies are not flagged. Instantiations in the
@noindent
Flag all local packages declared in package and generic package
-specifications.
+specs.
Local packages in bodies are not flagged.
This rule has no parameters.
This rule has no parameters.
@end ignore
+@node Metrics_Violation
+@subsection @code{Metrics_Violation}
+@cindex @code{Metrics} rule (for @command{gnatcheck})
+
+@noindent
+This is an umbrella rule for a set of metrics-based checks. The parameters of
+the rule specify which metrics should be checked, and a bound (upper or lower,
+depending on the metric) for each specified metric. A construct is
+flagged if a specified metric can be computed for it, and the resulting value
+is higher then the upper bound (or less than the lower bound) specified.
+
+This rule has the following parameters:
+
+@itemize @bullet
+@item
+For the @option{+R} option:
+@table @code
+@item @i{Metric_Check_Name} < @i{LowerBound}
+Turns the check for the specified metric ON and specifies the lower bound
+for a given metric check
+
+@item @i{Metric_Check_Name} > @i{UpperBound}
+
+Turns the check for the specified metric ON and specifies the upper bound
+for a given metric check
+@end table
+
+@item
+For the @option{-R} option:
+@table @code
+@item @i{Metric_Check_Name}
+Turns the check for the specified metric OFF
+@end table
+@end itemize
+
+@noindent
+Parameters are not case-sensitive. @i{Metric_Check_Name} must be
+the name of a metric supported by the @code{Metrics_Violation} rule
+(see the table below),
+otherwise the parameter is ignored. Whether the upper or lower bound
+is specified for a given check, depends on the metric. If a
+parameter for the @option{+R} option specifies an invalid limit, a
+warning is issued and the parameter is ignored.
+
+The @option{-R} option without parameters turns OFF all the previously enabled
+metric checks. the @option{+R} option without parameters turns ON all the
+metric checks that have been defined by previous @option{+R} options with
+valid parameters. @option{+R} option with a valid
+parameter also turns ON all the other metric checks that have been defined
+by previous @option{+R} options with valid parameters if they have been
+disabled by @option{-R} option without parameters.
+
+By default no metrics checks are ON, so the @option{+R} option without
+parameters actually does not specify any check.
+
+The following table shows the available metrics-based checks,
+including the constraint that must be satisfied by the bound that
+is specified for the check.
+
+@multitable {@code{Cyclomatic_Complexity}}{Cyclomatic complexity}{Positive integer}
+@ifnothtml
+@headitem Check Name @tab Description @tab Bounds Value
+@end ifnothtml
+@ifhtml
+@item @b{Check Name} @tab @b{Description} @tab @b{Bounds Value}
+@end ifhtml
+@c Above conditional code is workaround to bug in texi2html (Feb 2008)
+@item @code{Essential_Complexity} @tab Essential complexity @tab Positive integer
+@item @code{Cyclomatic_Complexity} @tab Cyclomatic complexity @tab Positive integer
+@item @code{LSLOC} @tab Logical Source Lines of Code @tab Positive integer
+@end multitable
+
+@noindent
+The meaning and the computed values for all these metrics are exactly
+the same as for the corresponding metrics in @command{gnatmetric}.
+
+@emph{Example:} the rule
+@smallexample
++RMetrics_Violation: Cyclomatic_Complexity > 7
+@end smallexample
+@noindent
+means that all bodies with cyclomatic complexity exceeding 7 will be flagged.
@node Misnamed_Identifiers
@subsection @code{Misnamed_Identifiers}
@item
@findex GNAT
Files with prefix @file{^g-^G-^} are children of @code{GNAT}. These are useful
-general-purpose packages, fully documented in their specifications. All
+general-purpose packages, fully documented in their specs. All
the other @file{.c} files are modifications of common @command{gcc} files.
@end itemize
@cindex @code{Aux_DEC} package (child of @code{System})
These definitions are incorporated directly into package @code{System},
as though they had been declared there. For a
-list of the declarations added, see the specification of this package,
+list of the declarations added, see the spec of this package,
which can be found in the file @file{s-auxdec.ads} in the GNAT library.
@cindex @file{s-auxdec.ads} file
The pragma @code{Extend_System} is a configuration pragma, which means that
@noindent
HP Ada provides a specific version of the package
@code{SYSTEM} for each platform on which the language is implemented.
-For the complete specification of the package @code{SYSTEM}, see
+For the complete spec of the package @code{SYSTEM}, see
Appendix F of the @cite{HP Ada Language Reference Manual}.
On HP Ada, the package @code{SYSTEM} includes the following conversion
@item Adding the proper notation to generic formal parameters
that take unconstrained types in instantiation
-@item Adding pragma @code{ELABORATE_BODY} to package specifications
+@item Adding pragma @code{ELABORATE_BODY} to package specs
that have package bodies not otherwise allowed
@item Replacing occurrences of the identifier ``@code{PROTECTED}'' by
@item @command{ACS ENTER FOREIGN}
@tab Copy (*)@*
Allows the import of a foreign body as an Ada library
-specification and enters a reference to a pointer.
+spec and enters a reference to a pointer.
@item @command{ACS ENTER UNIT}
@tab Copy (*)@*
@end smallexample
Compile the program with both optimization (@option{-O2}) and inlining
-enabled (@option{-gnatpn} instead of @option{-gnatp}).
+(@option{-gnatn}) enabled.
The @code{Incr} function is still compiled as usual, but at the
point in @code{Increment} where our function used to be called:
this in Ada 95 or Ada 2005:
@enumerate
@item
-If the source code for the libraries (specifications and bodies) are
+If the source code for the libraries (specs and bodies) are
available, then the libraries can be migrated in the same way as the
application.
@item
-If the source code for the specifications but not the bodies are
+If the source code for the specs but not the bodies are
available, then you can reimplement the bodies.
@item
Some features introduced by Ada 95 obviate the need for library support. For
All code that comes as part of GNAT is 64-bit clean, but the
restrictions given in @ref{Restrictions on use of 64 bit objects},
still apply. Look at the package
-specifications to see in which contexts objects allocated
+specs to see in which contexts objects allocated
in 64-bit address space are acceptable.
@node Technical details
b_ ^ B_
-b~ ^ B$
+b~ ^ B__
cc1 ^ CC1
Cc1 ^ CC1
emacs ^ EMACS
-gnatVa ^ /VALIDITY_CHECKING=ALL
-gnatVc ^ /VALIDITY_CHECKING=COPIES
-gnatVd ^ /VALIDITY_CHECKING=DEFAULT
+-gnatVE ^ /VALIDITY_CHECKING=NOCOMPONENTS
+-gnatVe ^ /VALIDITY_CHECKING=COMPONENTS
-gnatVD ^ /VALIDITY_CHECKING=NODEFAULT
-gnatVf ^ /VALIDITY_CHECKING=FLOATS
-gnatVi ^ /VALIDITY_CHECKING=IN_PARAMS
-gnatwd ^ /WARNINGS=IMPLICIT_DEREFERENCE
-gnatwD ^ /WARNINGS=NOIMPLICIT_DEREFERENCE
-gnatwe ^ /WARNINGS=ERRORS
+-gnatw.e ^ /WARNINGS=EVERY
-gnatwf ^ /WARNINGS=UNREFERENCED_FORMALS
-gnatwF ^ /WARNINGS=NOUNREFERENCED_FORMALS
-gnatwg ^ /WARNINGS=UNRECOGNIZED_PRAGMAS
-gnatw.O ^ /WARNINGS=NOOUT_PARAM_UNREF
-gnatwp ^ /WARNINGS=INEFFECTIVE_INLINE
-gnatwP ^ /WARNINGS=NOINEFFECTIVE_INLINE
+-gnatw.p ^ /WARNINGS=PARAMETER_ORDER
+-gnatw.P ^ /WARNINGS=NO_PARAMETER_ORDER
-gnatwq ^ /WARNINGS=MISSING_PARENS
-gnatwQ ^ /WARNINGS=NOMISSING_PARENS
-gnatwr ^ /WARNINGS=REDUNDANT
-- --
------------------------------------------------------------------------------
+-- Warning: the output of this usage for warnings is duplicated in the GNAT
+-- reference manual. Be sure to update that if you change the warning list.
+
with Targparm; use Targparm;
with Namet; use Namet;
with Opt; use Opt;
Write_Switch_Char ("wxx");
Write_Line ("Enable selected warning modes, xx = list of parameters:");
- Write_Line (" a turn on all optional warnings (except dhl.o.w)");
+ Write_Line (" a turn on all optional warnings " &
+ "(except dhl.ot.w)");
Write_Line (" A turn off all optional warnings");
Write_Line (" .a* turn on warnings for failing assertions");
Write_Line (" .A turn off warnings for failing assertions");
Write_Line (" d turn on warnings for implicit dereference");
Write_Line (" D* turn off warnings for implicit dereference");
Write_Line (" e treat all warnings as errors");
+ Write_Line (" .e turn on every optional warning (no exceptions)");
Write_Line (" f turn on warnings for unreferenced formal");
Write_Line (" F* turn off warnings for unreferenced formal");
Write_Line (" g* turn on warnings for unrecognized pragma");
Write_Line (" .O* turn off warnings for out parameters assigned " &
"but not read");
Write_Line (" p turn on warnings for ineffective pragma " &
- "Inline in frontend");
+ "Inline in frontend");
Write_Line (" P* turn off warnings for ineffective pragma " &
- "Inline in frontend");
+ "Inline in frontend");
+ Write_Line (" .p turn on warnings for suspicious parameter " &
+ "order");
+ Write_Line (" .P* turn off warnings for suspicious parameter " &
+ "order");
Write_Line (" q* turn on warnings for questionable " &
"missing parentheses");
Write_Line (" Q turn off warnings for questionable " &
Write_Line (" m check line length <= 79 characters");
Write_Line (" n check casing of package Standard identifiers");
Write_Line (" Mnn check line length <= nn characters");
+ Write_Line (" N turn off all checks");
Write_Line (" o check subprogram bodies in alphabetical order");
Write_Line (" p check pragma casing");
Write_Line (" r check casing for identifier references");
Write_Line (" t check token separation rules");
Write_Line (" u check no unnecessary blank lines");
Write_Line (" x check extra parentheses around conditionals");
+ Write_Line (" y turn on default style checks");
+ Write_Line (" - subtract (turn off) subsequent checks");
+ Write_Line (" + add (turn on) subsequent checks");
-- Lines for -gnatyN switch
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Output_Version is
begin
- Put ("GNAT ");
+ if AAMP_On_Target then
+ Put ("GNAAMP ");
+ else
+ Put ("GNAT ");
+ end if;
+
Put_Line (Gnatvsn.Gnat_Version_String);
Put_Line ("Copyright 1996-" &
Current_Year &
-- NOTE: the format of this package must follow the following rules, so that
-- the VMS GNAT help tool works properly:
--- - Each command zone (where the eventual qualifiers are declared must
+-- - Each command zone (where the eventual qualifiers are declared) must
-- begin with a boxed comment of the form:
-- ---------------------------------
S_Bind_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Example:
-- /EXTERNAL_REFERENCE="DEBUG=TRUE"
+ S_Bind_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Bind_Force : aliased constant S := "/FORCE_ELAB_FLAGS " &
"-F";
-- /NOFORCE_ELAB_FLAGS (D)
-- This qualifier has no impact, except when using the setjmp/longjmp
-- exception mechanism, with the GNAT COMPILE qualifier /LONGJMP_SETJMP.
+ S_Bind_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Bind_Time : aliased constant S := "/TIME_STAMP_CHECK " &
"!-t";
-- /TIME_STAMP_CHECK (D)
S_Bind_Elab 'Access,
S_Bind_Error 'Access,
S_Bind_Ext 'Access,
+ S_Bind_Follow 'Access,
S_Bind_Force 'Access,
S_Bind_Help 'Access,
S_Bind_Init 'Access,
S_Bind_Source 'Access,
S_Bind_Static 'Access,
S_Bind_Store 'Access,
+ S_Bind_Subdirs 'Access,
S_Bind_Time 'Access,
S_Bind_Verbose 'Access,
S_Bind_Warn 'Access,
S_Check_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Take as arguments the files that are listed in the specified
-- text file.
+ S_Check_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Check_Help : aliased constant S := "/HELP " &
"-h";
-- /NOHELP (D)
--
-- section-option may be one of the following:
--
- -- COMPILER_STYLE Include diagnoses in compile-style format
+ -- COMPILER_STYLE Include diagnostics in compile-style format
-- (diagoses are grouped by files, for each file
-- they are ordered according to the references
-- into the source)
- -- BY_RULES Include diagnoses grouped first by rules and
+ -- BY_RULES Include diagnostics grouped first by rules and
-- then by files
- -- BY_FILES_BY_RULES Include diagnoses grouped first by files and
+ -- BY_FILES_BY_RULES Include diagnostics grouped first by files and
-- then by rules
--
-- If one of these options is specified, then the report file contains
--
-- Generate a short form of the report file.
+ S_Check_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Check_Verb : aliased constant S := "/VERBOSE " &
"-v";
-- /NOVERBOSE (D)
S_Check_All 'Access,
S_Check_Ext 'Access,
S_Check_Files 'Access,
+ S_Check_Follow 'Access,
S_Check_Help 'Access,
S_Check_Locs 'Access,
S_Check_Mess 'Access,
S_Check_Quiet 'Access,
S_Check_Sections 'Access,
S_Check_Short 'Access,
+ S_Check_Subdirs 'Access,
S_Check_Verb 'Access);
----------------------------
S_Sync_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Take as arguments the files that are listed in the specified
-- text file.
+ S_Sync_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Sync_Mess : aliased constant S := "/MESSAGES_PROJECT_FILE=" &
"DEFAULT " &
"-vP0 " &
--
-- Work quietly, only output warnings and errors.
+ S_Sync_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Sync_Verb : aliased constant S := "/VERBOSE " &
"-v";
-- /NOVERBOSE (D)
(S_Sync_Add 'Access,
S_Sync_All 'Access,
S_Sync_Ext 'Access,
+ S_Sync_Follow 'Access,
S_Sync_Files 'Access,
S_Sync_Mess 'Access,
S_Sync_Project 'Access,
S_Sync_Quiet 'Access,
+ S_Sync_Subdirs 'Access,
S_Sync_Verb 'Access,
S_Sync_Exec 'Access,
S_Sync_Details 'Access,
S_Clean_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Example:
-- /EXTERNAL_REFERENCE="DEBUG=TRUE"
+ S_Clean_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Clean_Full : aliased constant S := "/FULL_PATH_IN_BRIEF_MESSAGES " &
"-F";
-- /NOFULL_PATH_IN_BRIEF_MESSAGES (D)
--
-- Equivalent to /OBJECT_SEARCH=(directory,...).
+ S_Clean_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Clean_Verbose : aliased constant S := "/VERBOSE " &
"-v";
-- /NOVERBOSE (D)
S_Clean_Delete 'Access,
S_Clean_Dirobj 'Access,
S_Clean_Ext 'Access,
+ S_Clean_Follow 'Access,
S_Clean_Full 'Access,
S_Clean_Help 'Access,
S_Clean_Index 'Access,
S_Clean_Quiet 'Access,
S_Clean_Recurs 'Access,
S_Clean_Search 'Access,
+ S_Clean_Subdirs'Access,
S_Clean_Verbose'Access);
-------------------------------
S_GCC_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
--
-- ASSERTIONS The pragmas "Assert" and "Debug" normally have no
-- effect and are ignored. This keyword causes "Assert"
- -- and "Debug" pragmas to be activated.
+ -- and "Debug" pragmas to be activated, as well as
+ -- "Check", "Precondition" and "Postcondition" pragmas.
--
-- SUPPRESS_ALL Suppress all runtime checks as though you have "pragma
-- Suppress (all_checks)" in your source. Use this switch
-- including the ADS or ADB filetype. The default is not to enable file
-- name krunching.
+ S_GCC_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_GCC_Force : aliased constant S := "/FORCE_ALI " &
"-gnatQ";
-- /NOFORCE_ALI (D)
S_GCC_Style : aliased constant S := "/STYLE_CHECKS=" &
"ALL_BUILTIN " &
- "-gnaty " &
+ "-gnatyy " &
+ "0 " &
+ "-gnaty0 " &
"1 " &
"-gnaty1 " &
"2 " &
"-gnaty9 " &
"ATTRIBUTE " &
"-gnatya " &
+ "NOATTRIBUTE " &
+ "-gnaty-a " &
"ARRAY_INDEXES " &
"-gnatyA " &
+ "NOARRAY_INDEXES " &
+ "-gnaty-A " &
"BLANKS " &
"-gnatyb " &
+ "NOBLANKS " &
+ "-gnaty-b " &
"COMMENTS " &
"-gnatyc " &
+ "NOCOMMENTS " &
+ "-gnaty-c " &
"DOS_LINE_ENDINGS " &
"-gnatyd " &
+ "NODOS_LINE_ENDINGS " &
+ "-gnaty-d " &
"END " &
"-gnatye " &
+ "NOEND " &
+ "-gnaty-e " &
"VTABS " &
"-gnatyf " &
+ "NOVTABS " &
+ "-gnaty-f " &
"GNAT " &
"-gnatyg " &
"HTABS " &
"-gnatyh " &
+ "NOHTABS " &
+ "-gnaty-h " &
"IF_THEN " &
"-gnatyi " &
+ "NOIF_THEN " &
+ "-gnaty-i " &
"KEYWORD " &
"-gnatyk " &
+ "NOKEYWORD " &
+ "-gnaty-k " &
"LAYOUT " &
"-gnatyl " &
+ "NOLAYOUT " &
+ "-gnaty-l " &
"LINE_LENGTH " &
"-gnatym " &
+ "NOLINE_LENGTH " &
+ "-gnaty-m " &
"MODE_IN " &
"-gnatyI " &
+ "NOMODE_IN " &
+ "-gnaty-I " &
"NONE " &
"-gnatyN " &
"STANDARD_CASING " &
"-gnatyn " &
+ "NOSTANDARD_CASING " &
+ "-gnaty-n " &
"ORDERED_SUBPROGRAMS " &
"-gnatyo " &
+ "NOORDERED_SUBPROGRAMS " &
+ "-gnaty-o " &
"PRAGMA " &
"-gnatyp " &
+ "NOPRAGMA " &
+ "-gnaty-p " &
"REFERENCES " &
"-gnatyr " &
+ "NOREFERENCES " &
+ "-gnaty-r " &
"SPECS " &
"-gnatys " &
+ "NOSPECS " &
+ "-gnaty-s " &
"STATEMENTS_AFTER_THEN_ELSE " &
"-gnatyS " &
+ "NOSTATEMENTS_AFTER_THEN_ELSE " &
+ "-gnaty-S " &
"TOKEN " &
"-gnatyt " &
+ "NOTOKEN " &
+ "-gnaty-t " &
"UNNECESSARY_BLANK_LINES " &
"-gnatyu " &
+ "NOUNNECESSARY_BLANK_LINES " &
+ "-gnaty-u " &
"XTRA_PARENS " &
- "-gnatyx ";
+ "-gnaty-x " &
+ "NOXTRA_PARENS " &
+ "-gnaty-x ";
-- /NOSTYLE_CHECKS (D)
-- /STYLE_CHECKS[=(keyword,[...])]
--
"!-gnatg,!-gnaty*";
-- NODOC (see /STYLE_CHECKS)
+ S_GCC_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_GCC_Symbol : aliased constant S := "/SYMBOL_PREPROCESSING=" & '"' &
"-gnateD" & '"';
-- /SYMBOL_PREPROCESSING="symbol=value"
"-gnatVc " &
"NOCOPIES " &
"-gnatVC " &
+ "COMPONENTS " &
+ "-gnatVe " &
+ "NOCOMPONENTS " &
+ "-gnatVE " &
"FLOATS " &
"-gnatVf " &
"NOFLOATS " &
"!-gnatws,!-gnatwe " &
"ALL " &
"-gnatwa " &
+ "EVERY " &
+ "-gnatw.e " &
"OPTIONAL " &
"-gnatwa " &
"NOOPTIONAL " &
"-gnatwP " &
"MISSING_PARENS " &
"-gnatwq " &
+ "PARAMETER_ORDER " &
+ "-gnatw.p " &
+ "NOPARAMETER_ORDER " &
+ "-gnatw.P " &
"NOMISSING_PARENS " &
"-gnatwQ " &
"REDUNDANT " &
-- ELABORATION. All other optional Ada
-- warnings are turned on.
--
+ -- EVERY Activate every optional warning.
+ -- Activates all optional warnings, including
+ -- those listed above as exceptions for ALL.
+ --
-- NOALL Suppress all optional errors.
-- Suppresses all optional warning messages
-- that can be activated by option ALL.
--
-- Inhibit all warning messages of the GCC back-end.
+ S_GCC_All_Back : aliased constant S := "/ALL_BACK_END_WARNINGS " &
+ "-Wall";
+ -- /ALL_BACK_END_WARNINGS
+ --
+ -- Activate all warning messages of the GCC back-end.
+
S_GCC_Wide : aliased constant S := "/WIDE_CHARACTER_ENCODING=" &
"BRACKETS " &
"-gnatWb " &
S_GCC_Extend 'Access,
S_GCC_Ext 'Access,
S_GCC_File 'Access,
+ S_GCC_Follow 'Access,
S_GCC_Force 'Access,
S_GCC_Full 'Access,
S_GCC_GNAT 'Access,
S_GCC_Search 'Access,
S_GCC_Style 'Access,
S_GCC_StyleX 'Access,
+ S_GCC_Subdirs 'Access,
S_GCC_Symbol 'Access,
S_GCC_Syntax 'Access,
S_GCC_Table 'Access,
S_GCC_Wide 'Access,
S_GCC_WideX 'Access,
S_GCC_No_Back 'Access,
+ S_GCC_All_Back'Access,
S_GCC_Xdebug 'Access,
S_GCC_Xref 'Access);
S_Elim_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Example:
-- /EXTERNAL_REFERENCE="DEBUG=TRUE"
+ S_Elim_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Elim_GNATMAKE : aliased constant S := "/GNATMAKE=@" &
"--GNATMAKE=@";
-- /GNATMAKE=path_name
--
-- When looking for source files also look in the specified directories.
+ S_Elim_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Elim_Verb : aliased constant S := "/VERBOSE " &
"-v";
-- /NOVERBOSE (D)
S_Elim_Config 'Access,
S_Elim_Current 'Access,
S_Elim_Ext 'Access,
+ S_Elim_Follow 'Access,
S_Elim_GNATMAKE'Access,
S_Elim_Mess 'Access,
S_Elim_Project 'Access,
S_Elim_Quiet 'Access,
S_Elim_Search 'Access,
+ S_Elim_Subdirs 'Access,
S_Elim_Verb 'Access);
----------------------------
S_Find_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Example:
-- /EXTERNAL_REFERENCE="DEBUG=TRUE"
+ S_Find_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Find_Full : aliased constant S := "/FULL_PATHNAME " &
"-f";
-- /NOFULL_PATHNAME (D)
-- The order in which source file search is undertaken is the same as for
-- MAKE.
+ S_Find_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Find_Types : aliased constant S := "/TYPE_HIERARCHY " &
"-t";
-- /NOTYPE_HIERARCHY (D)
S_Find_Deriv 'Access,
S_Find_Expr 'Access,
S_Find_Ext 'Access,
+ S_Find_Follow 'Access,
S_Find_Full 'Access,
S_Find_Ignore 'Access,
S_Find_Mess 'Access,
S_Find_Ref 'Access,
S_Find_Search 'Access,
S_Find_Source 'Access,
+ S_Find_Subdirs 'Access,
S_Find_Types 'Access);
------------------------------
S_Link_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Example:
-- /EXTERNAL_REFERENCE="DEBUG=TRUE"
+ S_Link_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Link_Forlink : aliased constant S := "/FOR_LINKER=" & '"' &
"--for-linker=" & '"';
-- /FOR_LINKER=<string>
--
-- Indicate to the linker that the link is static.
+ S_Link_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Link_Verb : aliased constant S := "/VERBOSE " &
"-v";
-- /NOVERBOSE (D)
S_Link_Nodebug 'Access,
S_Link_Execut 'Access,
S_Link_Ext 'Access,
+ S_Link_Follow 'Access,
S_Link_Forlink 'Access,
S_Link_Force 'Access,
S_Link_Ident 'Access,
S_Link_Project 'Access,
S_Link_Return 'Access,
S_Link_Static 'Access,
+ S_Link_Subdirs 'Access,
S_Link_Verb 'Access,
S_Link_ZZZZZ 'Access);
S_List_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Take as arguments the files that are listed in the specified
-- text file.
+ S_List_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_List_Mess : aliased constant S := "/MESSAGES_PROJECT_FILE=" &
"DEFAULT " &
"-vP0 " &
--
-- When looking for source files also look in the specified directories.
+ S_List_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
List_Switches : aliased constant Switches :=
(S_List_Add 'Access,
S_List_All 'Access,
S_List_Depend 'Access,
S_List_Ext 'Access,
S_List_Files 'Access,
+ S_List_Follow 'Access,
S_List_Mess 'Access,
S_List_Nostinc 'Access,
S_List_Object 'Access,
S_List_Output 'Access,
S_List_Project 'Access,
S_List_Search 'Access,
- S_List_Source 'Access);
+ S_List_Source 'Access,
+ S_List_Subdirs 'Access);
----------------------------
-- Switches for GNAT MAKE --
S_Make_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Example:
-- /EXTERNAL_REFERENCE="DEBUG=TRUE"
+ S_Make_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Make_Force : aliased constant S := "/FORCE_COMPILE " &
"-f";
-- /NOFORCE_COMPILE (D)
-- Output the commands for the compiler, the binder and the linker
-- on SYS$OUTPUT, instead of SYS$ERROR.
+ S_Make_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Make_Switch : aliased constant S := "/SWITCH_CHECK " &
"-s";
-- /NOSWITCH_CHECK (D)
S_Make_Doobj 'Access,
S_Make_Execut 'Access,
S_Make_Ext 'Access,
+ S_Make_Follow 'Access,
S_Make_Force 'Access,
S_Make_Full 'Access,
S_Make_Hi_Verb 'Access,
S_Make_Skip 'Access,
S_Make_Source 'Access,
S_Make_Stand 'Access,
+ S_Make_Subdirs 'Access,
S_Make_Switch 'Access,
S_Make_Unique 'Access,
S_Make_Use_Map 'Access,
S_Metric_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- /SYNTAX_METRICS(option, option ...)
--
-- Specifies the syntax element metrics to be computed (if at least one
- -- positive syntax element metric, line metric or complexity metric is
- -- specified then only explicitly specified specified syntax element
- -- metrics are computed and reported)
+ -- positive syntax element metric, line metric, complexity or coupling
+ -- metric is specified then only explicitly specified specified syntax
+ -- element metrics are computed and reported)
--
-- option may be one of the following:
--
-- /LINE_COUNT_METRICS=(option, option ...)
-- Specifies the line metrics to be computed (if at least one positive
- -- syntax element metric, line metric or complexity metric is specified
- -- then only explicitly specified specified line metrics are computed and
- -- reported)
+ -- syntax element metric, line metric, complexity or coupling metric is
+ -- specified then only explicitly specified specified line metrics are
+ -- computed and reported)
--
-- option may be one of the following:
--
-- /COMPLEXITY_METRICS=(option, option ...)
-- Specifies the complexity metrics to be computed (if at least one
- -- positive syntax element metric, line metric or complexity metric is
- -- specified then only explicitly specified specified line metrics are
- -- computed and reported)
+ -- positive syntax element metric, line metric, complexity or coupling
+ -- metric is specified then only explicitly specified specified complexity
+ -- metrics are computed and reported)
--
-- option may be one of the following:
--
--
-- All combinations of line metrics options are allowed.
+ S_Metric_Coupling : aliased constant S := "/COUPLING_METRICS=" &
+ "ALL_ON " &
+ "--coupling-all " &
+ "ALL_OFF " &
+ "--no-counling-all " &
+ "PACKAGE_EFFERENT_ON " &
+ "--package-efferent-coupling " &
+ "PACKAGE_EFFERENT_OFF " &
+ "--no-package-efferent-coupling " &
+ "PACKAGE_AFFERENT_ON " &
+ "--package-afferent-coupling " &
+ "PACKAGE_AFFERENT_OFF " &
+ "--no-package-afferent-coupling " &
+ "CATEGORY_EFFERENT_ON " &
+ "--category-efferent-coupling " &
+ "CATEGORY_EFFERENT_OFF " &
+ "--no-category-efferent-coupling " &
+ "CATEGORY_AFFERENT_ON " &
+ "--category-afferent-coupling " &
+ "CATEGORY_AFFERENT_OFF " &
+ "--no-category-afferent-coupling";
+
+ -- /COUPLING_METRICS=(option, option ...)
+
+ -- Specifies the coupling metrics to be computed.
+ --
+ -- option may be one of the following:
+ --
+ -- ALL_ON All the coupling metrics are computed
+ -- ALL_OFF (D) None of coupling metrics is computed
+ -- PACKAGE_EFFERENT_ON Compute package efferent coupling
+ -- PACKAGE_EFFERENT_OFF Do not compute package efferent coupling
+ -- PACKAGE_AFFERENT_ON Compute package afferent coupling
+ -- PACKAGE_AFFERENT_OFF Do not compute package afferent coupling
+ -- CATEGORY_EFFERENT_ON Compute category efferent coupling
+ -- CATEGORY_EFFERENT_OFF Do not compute category efferent coupling
+ -- CATEGORY_AFFERENT_ON Compute category afferent coupling
+ -- CATEGORY_AFFERENT_OFF Do not compute category afferent coupling
+ --
+ -- All combinations of coupling metrics options are allowed.
+
+ S_Metric_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Metric_No_Local : aliased constant S := "/NO_LOCAL_DETAILS " &
"-nolocal";
-- /LOCAL_DETAILS (D)
-- the number of program units left to be processed. This option turns
-- this trace off.
+ S_Metric_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Metric_Suffix : aliased constant S := "/SUFFIX_DETAILS=" & '"' &
"-o" & '"';
-- /SUFFIX_DETAILS=suffix
(S_Metric_Add 'Access,
S_Metric_All_Prjs 'Access,
S_Metric_Complexity 'Access,
+ S_Metric_Coupling 'Access,
S_Metric_Debug 'Access,
S_Metric_Direct 'Access,
S_Metric_Element 'Access,
S_Metric_Ext 'Access,
S_Metric_Files 'Access,
+ S_Metric_Follow 'Access,
S_Metric_Format 'Access,
S_Metric_Globout 'Access,
S_Metric_Line 'Access,
S_Metric_Project 'Access,
S_Metric_Quiet 'Access,
S_Metric_Suffix 'Access,
+ S_Metric_Subdirs 'Access,
S_Metric_Syntax 'Access,
S_Metric_Suppress 'Access,
S_Metric_Verbose 'Access,
-- qualifiers /SOURCE_DIRS as there are non empty lines in the specified
-- text file.
+ S_Name_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Name_Frng : aliased constant S := "/FOREIGN_PATTERN=" & '"' &
"-f" & '"';
-- /FOREIGN_PATTERN=<string>
-- one qualifier /PROJECT_FILE. When a qualifier /PROJECT_DILE is
-- specified, no qualifier /CONFIG_FILE may be specified.
+ S_Name_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Name_Verbose : aliased constant S := "/VERBOSE " &
"-v";
-- /NOVERBOSE (D)
-- those whose names end with '_NT.ADA'.
Name_Switches : aliased constant Switches :=
- (S_Name_Conf 'Access,
- S_Name_Dirs 'Access,
- S_Name_Dfile 'Access,
- S_Name_Frng 'Access,
- S_Name_Help 'Access,
- S_Name_Proj 'Access,
- S_Name_Verbose 'Access,
- S_Name_Excl 'Access);
+ (S_Name_Conf 'Access,
+ S_Name_Dirs 'Access,
+ S_Name_Dfile 'Access,
+ S_Name_Follow 'Access,
+ S_Name_Frng 'Access,
+ S_Name_Help 'Access,
+ S_Name_Proj 'Access,
+ S_Name_Subdirs 'Access,
+ S_Name_Verbose 'Access,
+ S_Name_Excl 'Access);
----------------------------------
-- Switches for GNAT PREPROCESS --
S_Pretty_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
--
-- layout-option may be one of the following:
--
- -- UNTOUCHED All the comments remain unchanged
+ -- UNTOUCHED All the comments remain unchanged
-- DEFAULT (D) GNAT style comment line indentation
-- STANDARD_INDENT Standard comment line indentation
-- GNAT_BEGINNING GNAT style comment beginning
-- Take as arguments the files that are listed in the specified
-- text file.
+ S_Pretty_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Pretty_Forced : aliased constant S := "/FORCED_OUTPUT=@" &
"-of@";
-- /FORCED_OUTPUT=file
--
-- MIXED_CASE Names are in mixed case.
- S_Pretty_No_Backup : aliased constant S := "/NO_BACKUP " &
+ S_Pretty_Replace_No_Backup : aliased constant S := "/REPLACE_NO_BACKUP " &
"-rnb";
-- /REPLACE_NO_BACKUP
--
--
-- Redirect the output to the standard output.
+ S_Pretty_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Pretty_Verbose : aliased constant S := "/VERBOSE " &
"-v";
-- /NOVERBOSE (D)
-- By default such warnings are not activated.
Pretty_Switches : aliased constant Switches :=
- (S_Pretty_Add 'Access,
- S_Pretty_Align 'Access,
- S_Pretty_All_Prjs 'Access,
- S_Pretty_Attrib 'Access,
- S_Pretty_Comments 'Access,
- S_Pretty_Compact_Is 'Access,
- S_Pretty_Config 'Access,
- S_Pretty_Constr 'Access,
- S_Pretty_Comind 'Access,
- S_Pretty_Current 'Access,
- S_Pretty_Dico 'Access,
- S_Pretty_Eol 'Access,
- S_Pretty_Ext 'Access,
- S_Pretty_Encoding 'Access,
- S_Pretty_Files 'Access,
- S_Pretty_Forced 'Access,
- S_Pretty_Formfeed 'Access,
- S_Pretty_Indent 'Access,
- S_Pretty_Keyword 'Access,
- S_Pretty_Maxlen 'Access,
- S_Pretty_Maxind 'Access,
- S_Pretty_Mess 'Access,
- S_Pretty_Names 'Access,
- S_Pretty_No_Backup 'Access,
- S_Pretty_No_Labels 'Access,
- S_Pretty_Notabs 'Access,
- S_Pretty_Output 'Access,
- S_Pretty_Override 'Access,
- S_Pretty_Pragma 'Access,
- S_Pretty_Replace 'Access,
- S_Pretty_Project 'Access,
- S_Pretty_RTS 'Access,
- S_Pretty_Search 'Access,
- S_Pretty_Sep_Loop_Then 'Access,
- S_Pretty_N_Sep_Loop_Then'Access,
- S_Pretty_Use_On_New_Line'Access,
- S_Pretty_Stnm_On_Nw_Line'Access,
- S_Pretty_Specific 'Access,
- S_Pretty_Standard 'Access,
- S_Pretty_Verbose 'Access,
- S_Pretty_Warnings 'Access);
+ (S_Pretty_Add 'Access,
+ S_Pretty_Align 'Access,
+ S_Pretty_All_Prjs 'Access,
+ S_Pretty_Attrib 'Access,
+ S_Pretty_Comments 'Access,
+ S_Pretty_Compact_Is 'Access,
+ S_Pretty_Config 'Access,
+ S_Pretty_Constr 'Access,
+ S_Pretty_Comind 'Access,
+ S_Pretty_Current 'Access,
+ S_Pretty_Dico 'Access,
+ S_Pretty_Eol 'Access,
+ S_Pretty_Ext 'Access,
+ S_Pretty_Encoding 'Access,
+ S_Pretty_Files 'Access,
+ S_Pretty_Follow 'Access,
+ S_Pretty_Forced 'Access,
+ S_Pretty_Formfeed 'Access,
+ S_Pretty_Indent 'Access,
+ S_Pretty_Keyword 'Access,
+ S_Pretty_Maxlen 'Access,
+ S_Pretty_Maxind 'Access,
+ S_Pretty_Mess 'Access,
+ S_Pretty_Names 'Access,
+ S_Pretty_No_Labels 'Access,
+ S_Pretty_Notabs 'Access,
+ S_Pretty_Output 'Access,
+ S_Pretty_Override 'Access,
+ S_Pretty_Pragma 'Access,
+ S_Pretty_Replace 'Access,
+ S_Pretty_Replace_No_Backup'Access,
+ S_Pretty_Project 'Access,
+ S_Pretty_RTS 'Access,
+ S_Pretty_Search 'Access,
+ S_Pretty_Sep_Loop_Then 'Access,
+ S_Pretty_N_Sep_Loop_Then 'Access,
+ S_Pretty_Subdirs 'Access,
+ S_Pretty_Use_On_New_Line 'Access,
+ S_Pretty_Stnm_On_Nw_Line 'Access,
+ S_Pretty_Specific 'Access,
+ S_Pretty_Standard 'Access,
+ S_Pretty_Verbose 'Access,
+ S_Pretty_Warnings 'Access);
------------------------------
-- Switches for GNAT SHARED --
S_Stack_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Take as arguments the files that are listed in the specified
-- text file.
+ S_Stack_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Stack_Help : aliased constant S := "/HELP " &
"-h";
-- /NOHELP (D)
-- Any symbol matching the regular expression will be considered as a
-- potential entry point for the analysis.
+ S_Stack_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Stack_Unbounded : aliased constant S := "/UNBOUNDED=#" &
"-d#";
-- /UNBOUNDED=nnn
S_Stack_Directory 'Access,
S_Stack_Entries 'Access,
S_Stack_Files 'Access,
+ S_Stack_Follow 'Access,
S_Stack_Help 'Access,
S_Stack_List 'Access,
S_Stack_Order 'Access,
S_Stack_Project 'Access,
S_Stack_Output 'Access,
S_Stack_Regexp 'Access,
+ S_Stack_Subdirs 'Access,
S_Stack_Unbounded 'Access,
S_Stack_Unknown 'Access,
S_Stack_Verbose 'Access,
S_Stub_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Example:
-- /EXTERNAL_REFERENCE="DEBUG=TRUE"
+ S_Stub_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Stub_Full : aliased constant S := "/FULL " &
"-f";
-- /NOFULL (D)
--
-- When looking for source files also look in directories specified.
+ S_Stub_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Stub_Tree : aliased constant S := "/TREE_FILE=" &
"OVERWRITE " &
"-t " &
S_Stub_Config 'Access,
S_Stub_Current 'Access,
S_Stub_Ext 'Access,
+ S_Stub_Follow 'Access,
S_Stub_Full 'Access,
S_Stub_Header 'Access,
S_Stub_Header_File'Access,
S_Stub_Project 'Access,
S_Stub_Quiet 'Access,
S_Stub_Search 'Access,
+ S_Stub_Subdirs 'Access,
S_Stub_Tree 'Access,
S_Stub_Verbose 'Access);
S_Xref_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" &
"-aP*";
- -- /ADD_PROJECT_SEARCH_PATH==(directory[,...])
+ -- /ADD_PROJECT_SEARCH_PATH=(directory[,...])
--
-- Add directories to the project search path.
-- Example:
-- /EXTERNAL_REFERENCE="DEBUG=TRUE"
+ S_Xref_Follow : aliased constant S := "/FOLLOW_LINKS_FOR_FILES " &
+ "-eL";
+ -- /NOFOLLOW_LINKS_FOR_FILES (D)
+ -- /FOLLOW_LINKS_FOR_FILES
+ --
+ -- Follow links when parsing project files
+
S_Xref_Full : aliased constant S := "/FULL_PATHNAME " &
"-f";
-- /NOFULL_PATHNAME (D)
-- The order in which source file search is undertaken is the same as for
-- MAKE.
+ S_Xref_Subdirs : aliased constant S := "/SUBDIRS=<" &
+ "--subdirs=>";
+ -- /SUBDIRS=dir
+ --
+ -- The actual directories (object, exec, library, ...) are subdirectories
+ -- of the directory specified in the project file. If the subdirectory
+ -- does not exist, it is created automatically.
+
S_Xref_Output : aliased constant S := "/UNUSED " &
"-u";
-- /SOURCE_SEARCH=(directory,...)
S_Xref_All 'Access,
S_Xref_Deriv 'Access,
S_Xref_Ext 'Access,
+ S_Xref_Follow 'Access,
S_Xref_Full 'Access,
S_Xref_Global 'Access,
S_Xref_Mess 'Access,
S_Xref_Prj 'Access,
S_Xref_Search 'Access,
S_Xref_Source 'Access,
+ S_Xref_Subdirs 'Access,
S_Xref_Output 'Access,
S_Xref_Tags 'Access);