[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In addition to the implementation dependent pragmas and attributes, and the implementation advice, there are a number of other Ada features that are potentially implementation dependent and are designated as implementation-defined. These are mentioned throughout the Ada Reference Manual, and are summarized in Annex M.
A requirement for conforming Ada compilers is that they provide documentation describing how the implementation deals with each of these issues. In this chapter you will find each point in Annex M listed, followed by a description of how GNAT handles the implementation dependence.
You can use this chapter as a guide to minimizing implementation dependent features in your programs if portability to other compilers and other operating systems is an important consideration. The numbers in each entry below correspond to the paragraph numbers in the Ada Reference Manual.
code_statement
s cause external
interactions. See 1.1.3(10).
Any code_statement
can potentially cause external interactions.
See section 1. Implementation Defined Pragmas.
Optimize
. See 2.8(27).
Pragma Optimize
, if given with a Time
or Space
parameter, checks that the optimization flag is set, and aborts if it is
not.
S'Image
when some of the graphic characters of
S'Wide_Image
are not defined in Character
. See
3.5(37).
The sequence of characters is as defined by the wide character encoding
method used for the source. See section on source representation for
further details.
Standard
. See 3.5.4(25).
Short_Short_Integer
Short_Integer
Integer
Long_Integer
Long_Long_Integer
Standard
. See 3.5.7(16).
Short_Float
Float
Long_Float
Long_Long_Float
Fine_Delta
is 2**(-63)
Fine_Delta
and do not result in a mantissa larger than 63 bits.
If the mantissa is larger than 53 bits on machines where Long_Long_Float
is 64 bits (true of all architectures except ia32), then the output from
Text_IO is accurate to only 53 bits, rather than the full mantissa. This
is because floating-point conversions are used to convert fixed point.
Tags.Expanded_Name
for types declared
within an unnamed block_statement
. See 3.9(10).
Block numbers of the form Bnnn
, where nnn is a
decimal integer are allocated.
gettimeofday
.
Calendar.Time
. See
9.6(23).
The time base used is that provided by the C library function
gettimeofday
.
Calendar
operations. See 9.6(24).
The time zone used by package Calendar
is the current system time zone
setting for local time, as accessed by the C library function
localtime
.
delay_until_statements
of
select_statements
. See 9.6(29).
There are no such limits.
Component_Size
is specified for the object. See
9.10(1).
Separate components are independently addressable if they do not share
overlapping storage units.
gcc
command.
If the partition contains no main program, or if the main program is in a language other than Ada, then GNAT provides the binder options `-z' and `-n' respectively, and in this case a list of units can be explicitly supplied to the binder for inclusion in the partition (all units needed by these units will also be included automatically). For full details on the use of these options, refer to section `The GNAT Make Program gnatmake' in GNAT User's Guide.
library_items
. See
10.2(18).
The first constraint on ordering is that it meets the requirements of
Chapter 10 of the Ada Reference Manual. This still leaves some
implementation dependent choices, which are resolved by first
elaborating bodies as early as possible (i.e., in preference to specs
where there is a choice), and second by evaluating the immediate with
clauses of a unit to determine the probably best choice, and
third by elaborating in alphabetical order of unit names
where a choice still remains.
Ada.Command_Line.Set_Exit_Status
).
Exception_Message
. See
11.4.1(10).
Exception message returns the null string unless a specific message has
been passed by the program.
Exceptions.Exception_Name
for types
declared within an unnamed block_statement
. See 11.4.1(12).
Blocks have implementation defined names of the form Bnnn
where nnn is an integer.
Exception_Information
. See 11.4.1(13).
Exception_Information
returns a string in the following format:
Exception_Name: nnnnn Message: mmmmm PID: ppp Load address: 0xhhhh Call stack traceback locations: 0xhhhh 0xhhhh 0xhhhh ... 0xhhh |
where
nnnn
is the fully qualified name of the exception in all upper
case letters. This line is always present.
mmmm
is the message (this line present only if message is non-null)
ppp
is the Process Id value as a decimal integer (this line is
present only if the Process Id is nonzero). Currently we are
not making use of this field.
The line terminator sequence at the end of each line, including
the last line is a single LF
character (16#0A#
).
The implementation defined check name Predicate_Check controls whether predicate checks are generated.
The implementation defined check name Validity_Check controls whether validity checks are generated.
In addition, a user program can add implementation-defined check names by means of the pragma Check_Name.
Size
for indefinite subtypes. See
13.3(48).
Size for an indefinite subtype is the maximum possible size, except that
for the case of a subprogram parameter, the size of the parameter object
is the actual size.
Word_Size
= Storage_Unit
, the default bit
ordering. See 13.5.3(5).
Word_Size
(32) is not the same as Storage_Unit
(8) for this
implementation, so no non-default bit ordering is supported. The default
bit ordering corresponds to the natural endianness of the target architecture.
System
and its language-defined children. See 13.7(2).
See the definition of these packages in files `system.ads' and
`s-stoele.ads'. Note that two declarations are added to package
System.
Max_Priority : constant Positive := Priority'Last; Max_Interrupt_Priority : constant Positive := Interrupt_Priority'Last; |
System.Machine_Code
, and the meaning of
code_statements
. See 13.8(7).
See the definition and documentation in file `s-maccod.ads'.
53. The semantics of operations on invalid representations. See 13.9.2(10-11). For assignments and other operations where the use of invalid values cannot result in erroneous behavior, the compiler ignores the possibility of invalid values. An exception is raised at the point where an invalid value would result in erroneous behavior. For example executing:
procedure invalidvals is X : Integer := -1; Y : Natural range 1 .. 10; for Y'Address use X'Address; Z : Natural range 1 .. 10; A : array (Natural range 1 .. 10) of Integer; begin Z := Y; -- no exception A (Z) := 3; -- exception raised; end; |
As indicated, an exception is raised on the array assignment, but not on the simple assignment of the invalid negative value from Y to Z.
Storage_Pool
is not specified for the type. See 13.11(17).
There are 3 different standard pools used by the compiler when
Storage_Pool
is not specified depending whether the type is local
to a subprogram or defined at the library level and whether
Storage_Size
is specified or not. See documentation in the runtime
library units System.Pool_Global
, System.Pool_Size
and
System.Pool_Local
in files `s-poosiz.ads',
`s-pooglo.ads' and `s-pooloc.ads' for full details on the
default pools used.
See documentation in the sources of the run time mentioned in paragraph
53 . All these pools are accessible by means of with
'ing
these units.
Storage_Size
. See 13.11(18).
Storage_Size
is measured in storage units, and refers to the
total space available for an access type collection, or to the primary
stack space for a task.
Restrictions
. See 13.12(7).
See section 4. Standard and Implementation Defined Restrictions.
Restrictions
pragmas. See 13.12(9).
Restrictions that can be checked at compile time result in illegalities
if violated. Currently there are no other consequences of violating
restrictions.
Read
and
Write
attributes of elementary types in terms of stream
elements. See 13.13.2(9).
The representation is the in-memory representation of the base type of
the type, using the number of bits corresponding to the
type'Size
value, and the natural ordering of the machine.
Standard
. See A.1(3).
See items describing the integer and floating-point types supported.
61. The string returned by Character_Set_Version
.
See A.3.5(3).
Ada.Wide_Characters.Handling.Character_Set_Version
returns
the string "Unicode 4.0", referring to version 4.0 of the
Unicode specification.
Numerics.Generic_Elementary_Functions
, when
Float_Type'Signed_Zeros
is True
. See A.5.1(46).
The sign of zeroes follows the requirements of the IEEE 754 standard on
floating-point.
Numerics.Float_Random.Max_Image_Width
. See A.5.2(27).
Maximum image width is 6864, see library file `s-rannum.ads'.
Numerics.Discrete_Random.Max_Image_Width
. See A.5.2(27).
Maximum image width is 6864, see library file `s-rannum.ads'.
Model_Mantissa
,
Model_Emin
, Model_Epsilon
, Model
,
Safe_First
, and Safe_Last
attributes, if the Numerics
Annex is not supported. See A.5.3(72).
Run the compiler with `-gnatS' to produce a listing of package
Standard
, has the values of all numeric attributes.
Buffer_Size
in Storage_IO
. See
A.9(10).
All type representations are contiguous, and the Buffer_Size
is
the value of type'Size
rounded up to the next storage unit
boundary.
Put
. See
A.10.9(36).
If more digits are requested in the output than are represented by the
precision of the value, zeroes are output in the corresponding least
significant digit positions.
Argument_Count
, Argument
, and
Command_Name
. See A.15(1).
These are mapped onto the argv
and argc
parameters of the
main program in the natural manner.
Form
parameter in procedure
Create_Directory
. See A.16(56).
The Form
parameter is not used.
Form
parameter in procedure
Create_Path
. See A.16(60).
The Form
parameter is not used.
Form
parameter in procedure
Copy_File
. See A.16(68).
The Form
parameter is case-insensitive.
Two fields are recognized in the Form
parameter:
preserve=<value>
mode=<value>
<value> starts immediately after the character '=' and ends with the character immediately preceding the next comma (',') or with the last character of the parameter.
The only possible values for preserve= are:
no_attributes
all_attributes
timestamps
The only possible values for mode= are:
copy
overwrite
append
If the Form parameter includes one or both of the fields and the value or values are incorrect, Copy_file fails with Use_Error.
Examples of correct Forms:
Form => "preserve=no_attributes,mode=overwrite" (the default) Form => "mode=append" Form => "mode=copy, preserve=all_attributes" |
Examples of incorrect Forms
Form => "preserve=junk" Form => "mode=internal, preserve=timestamps" |
Pattern
parameter, when not the null string,
in the Start_Search
and Search
procedures.
See A.16(104) and A.16(112).
When the Pattern
parameter is not the null string, it is interpreted
according to the syntax of regular expressions as defined in the
GNAT.Regexp
package.
See section 11.88 GNAT.Regexp
(`g-regexp.ads').
Ada
Ada_Pass_By_Copy
Ada_Pass_By_Reference
Assembler
Asm
Assembly
C
C_Pass_By_Copy
COBOL
C_Plus_Plus (or CPP)
Default
External
Fortran
Intrinsic
Import
with convention Intrinsic, see
separate section on Intrinsic Subprograms.
Stdcall
DLL
Win32
Stubbed
Program_Error
exception. If a
pragma Import
specifies convention stubbed
then no body need
be present at all. This convention is useful during development for the
inclusion of subprograms whose body has not yet been written.
Linker_Options
. See B.1(37).
The string passed to Linker_Options
is presented uninterpreted as
an argument to the link command, unless it contains ASCII.NUL characters.
NUL characters if they appear act as argument separators, so for example
pragma Linker_Options ("-labc" & ASCII.NUL & "-ldef"); |
causes two separate arguments -labc
and -ldef
to be passed to the
linker. The order of linker options is preserved for a given unit. The final
list of options passed to the linker is in reverse order of the elaboration
order. For example, linker options for a body always appear before the options
from the corresponding package spec.
Interfaces
and its language-defined descendants. See B.2(1).
See files with prefix `i-' in the distributed library.
Interfaces
. The contents of the visible part of package
Interfaces
. See B.2(11).
See files with prefix `i-' in the distributed library.
Floating
, Long_Floating
,
Binary
, Long_Binary
, Decimal_ Element
, and
COBOL_Character
; and the initialization of the variables
Ada_To_COBOL
and COBOL_To_Ada
, in
Interfaces.COBOL
. See B.4(50).
Floating
Long_Floating
Binary
Long_Binary
Decimal_Element
COBOL_Character
For initialization, see the file `i-cobol.ads' in the distributed library.
Ada.Interrupt_Names
in source file `a-intnam.ads' for details
on the interrupts supported on a particular target.
Discard_Names
. See C.5(7).
Pragma Discard_Names
causes names of enumeration literals to
be suppressed. In the presence of this pragma, the Image attribute
provides the image of the Pos of the literal, and Value accepts
Pos values.
Task_Identification.Image
attribute. See C.7.1(7).
The result of this attribute is a string that identifies
the object or component that denotes a given task. If a variable Var
has a task type, the image for this task will have the form Var_XXXXXXXX
,
where the suffix
is the hexadecimal representation of the virtual address of the corresponding
task control block. If the variable is an array of tasks, the image of each
task will have the form of an indexed component indicating the position of a
given task in the array, e.g. Group(5)_XXXXXXX
. If the task is a
component of a record, the image of the task will have the form of a selected
component. These rules are fully recursive, so that the image of a task that
is a subcomponent of a composite object corresponds to the expression that
designates this task.
If a task is created by an allocator, its image depends on the context. If the
allocator is part of an object declaration, the rules described above are used
to construct its image, and this image is not affected by subsequent
assignments. If the allocator appears within an expression, the image
includes only the name of the task type.
If the configuration pragma Discard_Names is present, or if the restriction
No_Implicit_Heap_Allocation is in effect, the image reduces to
the numeric suffix, that is to say the hexadecimal representation of the
virtual address of the control block of the task.
Current_Task
when in a protected entry
or interrupt handler. See C.7.1(17).
Protected entries or interrupt handlers can be executed by any
convenient thread, so the value of Current_Task
is undefined.
Current_Task
from an entry
body or interrupt handler. See C.7.1(19).
The effect of calling Current_Task
from an entry body or
interrupt handler is to return the identification of the task currently
executing the code.
Task_Attributes
. See C.7.2(19).
There are no implementation-defined aspects of Task_Attributes
.
Metrics
. See D(2).
The metrics information for GNAT depends on the performance of the
underlying operating system. The sources of the run-time for tasking
implementation, together with the output from `-gnatG' can be
used to determine the exact sequence of operating systems calls made
to implement various tasking constructs. Together with appropriate
information on the performance of the underlying operating system,
on the exact target in use, this information can be used to determine
the required metrics.
Any_Priority
and
Priority
. See D.1(11).
See declarations in file `system.ads'.
policy_identifiers
allowed
in a pragma Task_Dispatching_Policy
. See D.2.2(3).
There are no implementation-defined policy-identifiers allowed in this
pragma.
policy_identifiers
allowed
in a pragma Locking_Policy
. See D.3(4).
The two implementation defined policies permitted in GNAT are
Inheritance_Locking
and Conccurent_Readers_Locking
. On
targets that support the Inheritance_Locking
policy, locking is
implemented by inheritance, i.e. the task owning the lock operates
at a priority equal to the highest priority of any task currently
requesting the lock. On targets that support the
Conccurent_Readers_Locking
policy, locking is implemented with a
read/write lock allowing multiple propected object functions to enter
concurrently.
System.Interrupt_Priority'Last
as described in the Ada
Reference Manual D.3(10),
System.Priority'Last
.
Restrictions
. See D.7(20).
There are no such implementation-defined aspects.
Real_Time
. See D.8(17).
There are no implementation defined aspects of package Real_Time
.
delay_statements
. See D.9(8).
Any difference greater than one microsecond will cause the task to be
delayed (see D.9(7)).
Decimal
. See F.2(7).
Max_Scale
Min_Scale
Min_Delta
Max_Delta
Max_Decimal_Digits
Max_Picture_Length
in the package
Text_IO.Editing
. See F.3.3(16).
64
Max_Picture_Length
in the package
Wide_Text_IO.Editing
. See F.3.4(5).
64
Numerics.Generic_Complex_Types
, when
Real'Signed_Zeros
is True. See G.1.1(53).
The signs of zero values are as recommended by the relevant
implementation advice.
Numerics.Generic_Complex_Elementary_Functions
, when
Real'Signed_Zeros
is True
. See G.1.2(45).
The signs of zero values are as recommended by the relevant
implementation advice.
Machine_Overflows
attribute of the
result type is False
. See G.2.1(13).
Infinite and NaN values are produced as dictated by the IEEE
floating-point standard.
Note that on machines that are not fully compliant with the IEEE floating-point standard, such as Alpha, the `-mieee' compiler flag must be used for achieving IEEE conforming behavior (although at the cost of a significant performance penalty), so infinite and NaN values are properly generated.
universal_real
operand of a fixed
point multiplication or division for which the result shall be in the
perfect result set. See G.2.3(22).
The result is only defined to be in the perfect result set if the result
can be computed by a single scaling operation involving a scale factor
representable in 64-bits.
Machine_Overflows
attribute of the
result type is False
. See G.2.3(27).
Not relevant, Machine_Overflows
is True
for fixed-point
types.
Machine_Overflows
attribute of the
result type is False
. See G.2.4(4).
IEEE infinite and Nan values are produced as appropriate.
Machine_Overflows
attribute of the corresponding real type is
False
. See G.2.6(5).
IEEE infinite and Nan values are produced as appropriate.
Inspection_Point
. See H.3.2(8).
Pragma Inspection_Point
ensures that the variable is live and can
be examined by the debugger at the inspection point.
Restrictions
. See H.4(25).
There are no implementation-defined aspects of pragma Restrictions
. The
use of pragma Restrictions [No_Exceptions]
has no effect on the
generated code. Checks must suppressed by use of pragma Suppress
.
Restrictions
. See
H.4(27).
There are no restrictions on pragma Restrictions
.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |