annotate gcc/ada/doc/gnat_rm/implementation_advice.rst @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 .. _Implementation_Advice:
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 *********************
kono
parents:
diff changeset
4 Implementation Advice
kono
parents:
diff changeset
5 *********************
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 The main text of the Ada Reference Manual describes the required
kono
parents:
diff changeset
8 behavior of all Ada compilers, and the GNAT compiler conforms to
kono
parents:
diff changeset
9 these requirements.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 In addition, there are sections throughout the Ada Reference Manual headed
kono
parents:
diff changeset
12 by the phrase 'Implementation advice'. These sections are not normative,
kono
parents:
diff changeset
13 i.e., they do not specify requirements that all compilers must
kono
parents:
diff changeset
14 follow. Rather they provide advice on generally desirable behavior.
kono
parents:
diff changeset
15 They are not requirements, because they describe behavior that cannot
kono
parents:
diff changeset
16 be provided on all systems, or may be undesirable on some systems.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 As far as practical, GNAT follows the implementation advice in
kono
parents:
diff changeset
19 the Ada Reference Manual. Each such RM section corresponds to a section
kono
parents:
diff changeset
20 in this chapter whose title specifies the
kono
parents:
diff changeset
21 RM section number and paragraph number and the subject of
kono
parents:
diff changeset
22 the advice. The contents of each section consists of the RM text within
kono
parents:
diff changeset
23 quotation marks,
kono
parents:
diff changeset
24 followed by the GNAT interpretation of the advice. Most often, this simply says
kono
parents:
diff changeset
25 'followed', which means that GNAT follows the advice. However, in a
kono
parents:
diff changeset
26 number of cases, GNAT deliberately deviates from this advice, in which
kono
parents:
diff changeset
27 case the text describes what GNAT does and why.
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 .. index:: Error detection
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 RM 1.1.3(20): Error Detection
kono
parents:
diff changeset
32 =============================
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 "If an implementation detects the use of an unsupported Specialized Needs
kono
parents:
diff changeset
35 Annex feature at run time, it should raise ``Program_Error`` if
kono
parents:
diff changeset
36 feasible."
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 Not relevant. All specialized needs annex features are either supported,
kono
parents:
diff changeset
39 or diagnosed at compile time.
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 .. index:: Child Units
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 RM 1.1.3(31): Child Units
kono
parents:
diff changeset
44 =========================
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 "If an implementation wishes to provide implementation-defined
kono
parents:
diff changeset
48 extensions to the functionality of a language-defined library unit, it
kono
parents:
diff changeset
49 should normally do so by adding children to the library unit."
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 Followed.
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 .. index:: Bounded errors
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 RM 1.1.5(12): Bounded Errors
kono
parents:
diff changeset
56 ============================
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 "If an implementation detects a bounded error or erroneous
kono
parents:
diff changeset
59 execution, it should raise ``Program_Error``."
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 Followed in all cases in which the implementation detects a bounded
kono
parents:
diff changeset
62 error or erroneous execution. Not all such situations are detected at
kono
parents:
diff changeset
63 runtime.
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 .. index:: Pragmas
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 .. _RM_2_8_16_Pragmas:
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 RM 2.8(16): Pragmas
kono
parents:
diff changeset
70 ===================
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 "Normally, implementation-defined pragmas should have no semantic effect
kono
parents:
diff changeset
73 for error-free programs; that is, if the implementation-defined pragmas
kono
parents:
diff changeset
74 are removed from a working program, the program should still be legal,
kono
parents:
diff changeset
75 and should still have the same semantics."
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 The following implementation defined pragmas are exceptions to this
kono
parents:
diff changeset
78 rule:
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 +--------------------+-------------------+
kono
parents:
diff changeset
81 | Pragma | Explanation |
kono
parents:
diff changeset
82 +====================+===================+
kono
parents:
diff changeset
83 | *Abort_Defer* | Affects semantics |
kono
parents:
diff changeset
84 +--------------------+-------------------+
kono
parents:
diff changeset
85 |*Ada_83* | Affects legality |
kono
parents:
diff changeset
86 +--------------------+-------------------+
kono
parents:
diff changeset
87 |*Assert* | Affects semantics |
kono
parents:
diff changeset
88 +--------------------+-------------------+
kono
parents:
diff changeset
89 |*CPP_Class* | Affects semantics |
kono
parents:
diff changeset
90 +--------------------+-------------------+
kono
parents:
diff changeset
91 |*CPP_Constructor* | Affects semantics |
kono
parents:
diff changeset
92 +--------------------+-------------------+
kono
parents:
diff changeset
93 |*Debug* | Affects semantics |
kono
parents:
diff changeset
94 +--------------------+-------------------+
kono
parents:
diff changeset
95 |*Interface_Name* | Affects semantics |
kono
parents:
diff changeset
96 +--------------------+-------------------+
kono
parents:
diff changeset
97 |*Machine_Attribute* | Affects semantics |
kono
parents:
diff changeset
98 +--------------------+-------------------+
kono
parents:
diff changeset
99 |*Unimplemented_Unit*| Affects legality |
kono
parents:
diff changeset
100 +--------------------+-------------------+
kono
parents:
diff changeset
101 |*Unchecked_Union* | Affects semantics |
kono
parents:
diff changeset
102 +--------------------+-------------------+
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 In each of the above cases, it is essential to the purpose of the pragma
kono
parents:
diff changeset
105 that this advice not be followed. For details see
kono
parents:
diff changeset
106 :ref:`Implementation_Defined_Pragmas`.
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 RM 2.8(17-19): Pragmas
kono
parents:
diff changeset
109 ======================
kono
parents:
diff changeset
110
kono
parents:
diff changeset
111 "Normally, an implementation should not define pragmas that can
kono
parents:
diff changeset
112 make an illegal program legal, except as follows:
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 * A pragma used to complete a declaration, such as a pragma ``Import``;
kono
parents:
diff changeset
115
kono
parents:
diff changeset
116 * A pragma used to configure the environment by adding, removing, or
kono
parents:
diff changeset
117 replacing ``library_items``."
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 See :ref:`RM_2_8_16_Pragmas`.
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 .. index:: Character Sets
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 .. index:: Alternative Character Sets
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 RM 3.5.2(5): Alternative Character Sets
kono
parents:
diff changeset
126 =======================================
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128 "If an implementation supports a mode with alternative interpretations
kono
parents:
diff changeset
129 for ``Character`` and ``Wide_Character``, the set of graphic
kono
parents:
diff changeset
130 characters of ``Character`` should nevertheless remain a proper
kono
parents:
diff changeset
131 subset of the set of graphic characters of ``Wide_Character``. Any
kono
parents:
diff changeset
132 character set 'localizations' should be reflected in the results of
kono
parents:
diff changeset
133 the subprograms defined in the language-defined package
kono
parents:
diff changeset
134 ``Characters.Handling`` (see A.3) available in such a mode. In a mode with
kono
parents:
diff changeset
135 an alternative interpretation of ``Character``, the implementation should
kono
parents:
diff changeset
136 also support a corresponding change in what is a legal
kono
parents:
diff changeset
137 ``identifier_letter``."
kono
parents:
diff changeset
138
kono
parents:
diff changeset
139 Not all wide character modes follow this advice, in particular the JIS
kono
parents:
diff changeset
140 and IEC modes reflect standard usage in Japan, and in these encoding,
kono
parents:
diff changeset
141 the upper half of the Latin-1 set is not part of the wide-character
kono
parents:
diff changeset
142 subset, since the most significant bit is used for wide character
kono
parents:
diff changeset
143 encoding. However, this only applies to the external forms. Internally
kono
parents:
diff changeset
144 there is no such restriction.
kono
parents:
diff changeset
145
kono
parents:
diff changeset
146 .. index:: Integer types
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 RM 3.5.4(28): Integer Types
kono
parents:
diff changeset
149 ===========================
kono
parents:
diff changeset
150
kono
parents:
diff changeset
151 "An implementation should support ``Long_Integer`` in addition to
kono
parents:
diff changeset
152 ``Integer`` if the target machine supports 32-bit (or longer)
kono
parents:
diff changeset
153 arithmetic. No other named integer subtypes are recommended for package
kono
parents:
diff changeset
154 ``Standard``. Instead, appropriate named integer subtypes should be
kono
parents:
diff changeset
155 provided in the library package ``Interfaces`` (see B.2)."
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 ``Long_Integer`` is supported. Other standard integer types are supported
kono
parents:
diff changeset
158 so this advice is not fully followed. These types
kono
parents:
diff changeset
159 are supported for convenient interface to C, and so that all hardware
kono
parents:
diff changeset
160 types of the machine are easily available.
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 RM 3.5.4(29): Integer Types
kono
parents:
diff changeset
163 ===========================
kono
parents:
diff changeset
164
kono
parents:
diff changeset
165 "An implementation for a two's complement machine should support
kono
parents:
diff changeset
166 modular types with a binary modulus up to ``System.Max_Int*2+2``. An
kono
parents:
diff changeset
167 implementation should support a non-binary modules up to ``Integer'Last``."
kono
parents:
diff changeset
168
kono
parents:
diff changeset
169 Followed.
kono
parents:
diff changeset
170
kono
parents:
diff changeset
171 .. index:: Enumeration values
kono
parents:
diff changeset
172
kono
parents:
diff changeset
173 RM 3.5.5(8): Enumeration Values
kono
parents:
diff changeset
174 ===============================
kono
parents:
diff changeset
175
kono
parents:
diff changeset
176 "For the evaluation of a call on ``S'Pos`` for an enumeration
kono
parents:
diff changeset
177 subtype, if the value of the operand does not correspond to the internal
kono
parents:
diff changeset
178 code for any enumeration literal of its type (perhaps due to an
kono
parents:
diff changeset
179 un-initialized variable), then the implementation should raise
kono
parents:
diff changeset
180 ``Program_Error``. This is particularly important for enumeration
kono
parents:
diff changeset
181 types with noncontiguous internal codes specified by an
kono
parents:
diff changeset
182 enumeration_representation_clause."
kono
parents:
diff changeset
183
kono
parents:
diff changeset
184 Followed.
kono
parents:
diff changeset
185
kono
parents:
diff changeset
186 .. index:: Float types
kono
parents:
diff changeset
187
kono
parents:
diff changeset
188 RM 3.5.7(17): Float Types
kono
parents:
diff changeset
189 =========================
kono
parents:
diff changeset
190
kono
parents:
diff changeset
191 "An implementation should support ``Long_Float`` in addition to
kono
parents:
diff changeset
192 ``Float`` if the target machine supports 11 or more digits of
kono
parents:
diff changeset
193 precision. No other named floating point subtypes are recommended for
kono
parents:
diff changeset
194 package ``Standard``. Instead, appropriate named floating point subtypes
kono
parents:
diff changeset
195 should be provided in the library package ``Interfaces`` (see B.2)."
kono
parents:
diff changeset
196
kono
parents:
diff changeset
197 ``Short_Float`` and ``Long_Long_Float`` are also provided. The
kono
parents:
diff changeset
198 former provides improved compatibility with other implementations
kono
parents:
diff changeset
199 supporting this type. The latter corresponds to the highest precision
kono
parents:
diff changeset
200 floating-point type supported by the hardware. On most machines, this
kono
parents:
diff changeset
201 will be the same as ``Long_Float``, but on some machines, it will
kono
parents:
diff changeset
202 correspond to the IEEE extended form. The notable case is all ia32
kono
parents:
diff changeset
203 (x86) implementations, where ``Long_Long_Float`` corresponds to
kono
parents:
diff changeset
204 the 80-bit extended precision format supported in hardware on this
kono
parents:
diff changeset
205 processor. Note that the 128-bit format on SPARC is not supported,
kono
parents:
diff changeset
206 since this is a software rather than a hardware format.
kono
parents:
diff changeset
207
kono
parents:
diff changeset
208 .. index:: Multidimensional arrays
kono
parents:
diff changeset
209
kono
parents:
diff changeset
210 .. index:: Arrays, multidimensional
kono
parents:
diff changeset
211
kono
parents:
diff changeset
212 RM 3.6.2(11): Multidimensional Arrays
kono
parents:
diff changeset
213 =====================================
kono
parents:
diff changeset
214
kono
parents:
diff changeset
215 "An implementation should normally represent multidimensional arrays in
kono
parents:
diff changeset
216 row-major order, consistent with the notation used for multidimensional
kono
parents:
diff changeset
217 array aggregates (see 4.3.3). However, if a pragma ``Convention``
kono
parents:
diff changeset
218 (``Fortran``, ...) applies to a multidimensional array type, then
kono
parents:
diff changeset
219 column-major order should be used instead (see B.5, *Interfacing with Fortran*)."
kono
parents:
diff changeset
220
kono
parents:
diff changeset
221 Followed.
kono
parents:
diff changeset
222
kono
parents:
diff changeset
223 .. index:: Duration'Small
kono
parents:
diff changeset
224
kono
parents:
diff changeset
225 RM 9.6(30-31): Duration'Small
kono
parents:
diff changeset
226 =============================
kono
parents:
diff changeset
227
kono
parents:
diff changeset
228 "Whenever possible in an implementation, the value of ``Duration'Small``
kono
parents:
diff changeset
229 should be no greater than 100 microseconds."
kono
parents:
diff changeset
230
kono
parents:
diff changeset
231 Followed. (``Duration'Small`` = 10**(-9)).
kono
parents:
diff changeset
232
kono
parents:
diff changeset
233 "The time base for ``delay_relative_statements`` should be monotonic;
kono
parents:
diff changeset
234 it need not be the same time base as used for ``Calendar.Clock``."
kono
parents:
diff changeset
235
kono
parents:
diff changeset
236 Followed.
kono
parents:
diff changeset
237
kono
parents:
diff changeset
238 RM 10.2.1(12): Consistent Representation
kono
parents:
diff changeset
239 ========================================
kono
parents:
diff changeset
240
kono
parents:
diff changeset
241 "In an implementation, a type declared in a pre-elaborated package should
kono
parents:
diff changeset
242 have the same representation in every elaboration of a given version of
kono
parents:
diff changeset
243 the package, whether the elaborations occur in distinct executions of
kono
parents:
diff changeset
244 the same program, or in executions of distinct programs or partitions
kono
parents:
diff changeset
245 that include the given version."
kono
parents:
diff changeset
246
kono
parents:
diff changeset
247 Followed, except in the case of tagged types. Tagged types involve
kono
parents:
diff changeset
248 implicit pointers to a local copy of a dispatch table, and these pointers
kono
parents:
diff changeset
249 have representations which thus depend on a particular elaboration of the
kono
parents:
diff changeset
250 package. It is not easy to see how it would be possible to follow this
kono
parents:
diff changeset
251 advice without severely impacting efficiency of execution.
kono
parents:
diff changeset
252
kono
parents:
diff changeset
253 .. index:: Exception information
kono
parents:
diff changeset
254
kono
parents:
diff changeset
255 RM 11.4.1(19): Exception Information
kono
parents:
diff changeset
256 ====================================
kono
parents:
diff changeset
257
kono
parents:
diff changeset
258 "``Exception_Message`` by default and ``Exception_Information``
kono
parents:
diff changeset
259 should produce information useful for
kono
parents:
diff changeset
260 debugging. ``Exception_Message`` should be short, about one
kono
parents:
diff changeset
261 line. ``Exception_Information`` can be long. ``Exception_Message``
kono
parents:
diff changeset
262 should not include the
kono
parents:
diff changeset
263 ``Exception_Name``. ``Exception_Information`` should include both
kono
parents:
diff changeset
264 the ``Exception_Name`` and the ``Exception_Message``."
kono
parents:
diff changeset
265
kono
parents:
diff changeset
266 Followed. For each exception that doesn't have a specified
kono
parents:
diff changeset
267 ``Exception_Message``, the compiler generates one containing the location
kono
parents:
diff changeset
268 of the raise statement. This location has the form 'file_name:line', where
kono
parents:
diff changeset
269 file_name is the short file name (without path information) and line is the line
kono
parents:
diff changeset
270 number in the file. Note that in the case of the Zero Cost Exception
kono
parents:
diff changeset
271 mechanism, these messages become redundant with the Exception_Information that
kono
parents:
diff changeset
272 contains a full backtrace of the calling sequence, so they are disabled.
kono
parents:
diff changeset
273 To disable explicitly the generation of the source location message, use the
kono
parents:
diff changeset
274 Pragma ``Discard_Names``.
kono
parents:
diff changeset
275
kono
parents:
diff changeset
276 .. index:: Suppression of checks
kono
parents:
diff changeset
277
kono
parents:
diff changeset
278 .. index:: Checks, suppression of
kono
parents:
diff changeset
279
kono
parents:
diff changeset
280 RM 11.5(28): Suppression of Checks
kono
parents:
diff changeset
281 ==================================
kono
parents:
diff changeset
282
kono
parents:
diff changeset
283 "The implementation should minimize the code executed for checks that
kono
parents:
diff changeset
284 have been suppressed."
kono
parents:
diff changeset
285
kono
parents:
diff changeset
286 Followed.
kono
parents:
diff changeset
287
kono
parents:
diff changeset
288 .. index:: Representation clauses
kono
parents:
diff changeset
289
kono
parents:
diff changeset
290 RM 13.1 (21-24): Representation Clauses
kono
parents:
diff changeset
291 =======================================
kono
parents:
diff changeset
292
kono
parents:
diff changeset
293 "The recommended level of support for all representation items is
kono
parents:
diff changeset
294 qualified as follows:
kono
parents:
diff changeset
295
kono
parents:
diff changeset
296 An implementation need not support representation items containing
kono
parents:
diff changeset
297 nonstatic expressions, except that an implementation should support a
kono
parents:
diff changeset
298 representation item for a given entity if each nonstatic expression in
kono
parents:
diff changeset
299 the representation item is a name that statically denotes a constant
kono
parents:
diff changeset
300 declared before the entity."
kono
parents:
diff changeset
301
kono
parents:
diff changeset
302 Followed. In fact, GNAT goes beyond the recommended level of support
kono
parents:
diff changeset
303 by allowing nonstatic expressions in some representation clauses even
kono
parents:
diff changeset
304 without the need to declare constants initialized with the values of
kono
parents:
diff changeset
305 such expressions.
kono
parents:
diff changeset
306 For example:
kono
parents:
diff changeset
307
kono
parents:
diff changeset
308 .. code-block:: ada
kono
parents:
diff changeset
309
kono
parents:
diff changeset
310 X : Integer;
kono
parents:
diff changeset
311 Y : Float;
kono
parents:
diff changeset
312 for Y'Address use X'Address;>>
kono
parents:
diff changeset
313
kono
parents:
diff changeset
314
kono
parents:
diff changeset
315 "An implementation need not support a specification for the ``Size``
kono
parents:
diff changeset
316 for a given composite subtype, nor the size or storage place for an
kono
parents:
diff changeset
317 object (including a component) of a given composite subtype, unless the
kono
parents:
diff changeset
318 constraints on the subtype and its composite subcomponents (if any) are
kono
parents:
diff changeset
319 all static constraints."
kono
parents:
diff changeset
320
kono
parents:
diff changeset
321 Followed. Size Clauses are not permitted on nonstatic components, as
kono
parents:
diff changeset
322 described above.
kono
parents:
diff changeset
323
kono
parents:
diff changeset
324
kono
parents:
diff changeset
325 "An aliased component, or a component whose type is by-reference, should
kono
parents:
diff changeset
326 always be allocated at an addressable location."
kono
parents:
diff changeset
327
kono
parents:
diff changeset
328 Followed.
kono
parents:
diff changeset
329
kono
parents:
diff changeset
330 .. index:: Packed types
kono
parents:
diff changeset
331
kono
parents:
diff changeset
332 RM 13.2(6-8): Packed Types
kono
parents:
diff changeset
333 ==========================
kono
parents:
diff changeset
334
kono
parents:
diff changeset
335 "If a type is packed, then the implementation should try to minimize
kono
parents:
diff changeset
336 storage allocated to objects of the type, possibly at the expense of
kono
parents:
diff changeset
337 speed of accessing components, subject to reasonable complexity in
kono
parents:
diff changeset
338 addressing calculations.
kono
parents:
diff changeset
339
kono
parents:
diff changeset
340 The recommended level of support pragma ``Pack`` is:
kono
parents:
diff changeset
341
kono
parents:
diff changeset
342 For a packed record type, the components should be packed as tightly as
kono
parents:
diff changeset
343 possible subject to the Sizes of the component subtypes, and subject to
kono
parents:
diff changeset
344 any *record_representation_clause* that applies to the type; the
kono
parents:
diff changeset
345 implementation may, but need not, reorder components or cross aligned
kono
parents:
diff changeset
346 word boundaries to improve the packing. A component whose ``Size`` is
kono
parents:
diff changeset
347 greater than the word size may be allocated an integral number of words."
kono
parents:
diff changeset
348
kono
parents:
diff changeset
349 Followed. Tight packing of arrays is supported for all component sizes
kono
parents:
diff changeset
350 up to 64-bits. If the array component size is 1 (that is to say, if
kono
parents:
diff changeset
351 the component is a boolean type or an enumeration type with two values)
kono
parents:
diff changeset
352 then values of the type are implicitly initialized to zero. This
kono
parents:
diff changeset
353 happens both for objects of the packed type, and for objects that have a
kono
parents:
diff changeset
354 subcomponent of the packed type.
kono
parents:
diff changeset
355
kono
parents:
diff changeset
356
kono
parents:
diff changeset
357 "An implementation should support Address clauses for imported
kono
parents:
diff changeset
358 subprograms."
kono
parents:
diff changeset
359
kono
parents:
diff changeset
360 Followed.
kono
parents:
diff changeset
361
kono
parents:
diff changeset
362 .. index:: Address clauses
kono
parents:
diff changeset
363
kono
parents:
diff changeset
364 RM 13.3(14-19): Address Clauses
kono
parents:
diff changeset
365 ===============================
kono
parents:
diff changeset
366
kono
parents:
diff changeset
367 "For an array ``X``, ``X'Address`` should point at the first
kono
parents:
diff changeset
368 component of the array, and not at the array bounds."
kono
parents:
diff changeset
369
kono
parents:
diff changeset
370 Followed.
kono
parents:
diff changeset
371
kono
parents:
diff changeset
372 "The recommended level of support for the ``Address`` attribute is:
kono
parents:
diff changeset
373
kono
parents:
diff changeset
374 ``X'Address`` should produce a useful result if ``X`` is an
kono
parents:
diff changeset
375 object that is aliased or of a by-reference type, or is an entity whose
kono
parents:
diff changeset
376 ``Address`` has been specified."
kono
parents:
diff changeset
377
kono
parents:
diff changeset
378 Followed. A valid address will be produced even if none of those
kono
parents:
diff changeset
379 conditions have been met. If necessary, the object is forced into
kono
parents:
diff changeset
380 memory to ensure the address is valid.
kono
parents:
diff changeset
381
kono
parents:
diff changeset
382 "An implementation should support ``Address`` clauses for imported
kono
parents:
diff changeset
383 subprograms."
kono
parents:
diff changeset
384
kono
parents:
diff changeset
385 Followed.
kono
parents:
diff changeset
386
kono
parents:
diff changeset
387 "Objects (including subcomponents) that are aliased or of a by-reference
kono
parents:
diff changeset
388 type should be allocated on storage element boundaries."
kono
parents:
diff changeset
389
kono
parents:
diff changeset
390 Followed.
kono
parents:
diff changeset
391
kono
parents:
diff changeset
392 "If the ``Address`` of an object is specified, or it is imported or exported,
kono
parents:
diff changeset
393 then the implementation should not perform optimizations based on
kono
parents:
diff changeset
394 assumptions of no aliases."
kono
parents:
diff changeset
395
kono
parents:
diff changeset
396 Followed.
kono
parents:
diff changeset
397
kono
parents:
diff changeset
398 .. index:: Alignment clauses
kono
parents:
diff changeset
399
kono
parents:
diff changeset
400 RM 13.3(29-35): Alignment Clauses
kono
parents:
diff changeset
401 =================================
kono
parents:
diff changeset
402
kono
parents:
diff changeset
403 "The recommended level of support for the ``Alignment`` attribute for
kono
parents:
diff changeset
404 subtypes is:
kono
parents:
diff changeset
405
kono
parents:
diff changeset
406 An implementation should support specified Alignments that are factors
kono
parents:
diff changeset
407 and multiples of the number of storage elements per word, subject to the
kono
parents:
diff changeset
408 following:"
kono
parents:
diff changeset
409
kono
parents:
diff changeset
410 Followed.
kono
parents:
diff changeset
411
kono
parents:
diff changeset
412 "An implementation need not support specified Alignments for
kono
parents:
diff changeset
413 combinations of Sizes and Alignments that cannot be easily
kono
parents:
diff changeset
414 loaded and stored by available machine instructions."
kono
parents:
diff changeset
415
kono
parents:
diff changeset
416 Followed.
kono
parents:
diff changeset
417
kono
parents:
diff changeset
418 "An implementation need not support specified Alignments that are
kono
parents:
diff changeset
419 greater than the maximum ``Alignment`` the implementation ever returns by
kono
parents:
diff changeset
420 default."
kono
parents:
diff changeset
421
kono
parents:
diff changeset
422 Followed.
kono
parents:
diff changeset
423
kono
parents:
diff changeset
424 "The recommended level of support for the ``Alignment`` attribute for
kono
parents:
diff changeset
425 objects is:
kono
parents:
diff changeset
426
kono
parents:
diff changeset
427 Same as above, for subtypes, but in addition:"
kono
parents:
diff changeset
428
kono
parents:
diff changeset
429 Followed.
kono
parents:
diff changeset
430
kono
parents:
diff changeset
431 "For stand-alone library-level objects of statically constrained
kono
parents:
diff changeset
432 subtypes, the implementation should support all alignments
kono
parents:
diff changeset
433 supported by the target linker. For example, page alignment is likely to
kono
parents:
diff changeset
434 be supported for such objects, but not for subtypes."
kono
parents:
diff changeset
435
kono
parents:
diff changeset
436 Followed.
kono
parents:
diff changeset
437
kono
parents:
diff changeset
438 .. index:: Size clauses
kono
parents:
diff changeset
439
kono
parents:
diff changeset
440 RM 13.3(42-43): Size Clauses
kono
parents:
diff changeset
441 ============================
kono
parents:
diff changeset
442
kono
parents:
diff changeset
443 "The recommended level of support for the ``Size`` attribute of
kono
parents:
diff changeset
444 objects is:
kono
parents:
diff changeset
445
kono
parents:
diff changeset
446 A ``Size`` clause should be supported for an object if the specified
kono
parents:
diff changeset
447 ``Size`` is at least as large as its subtype's ``Size``, and
kono
parents:
diff changeset
448 corresponds to a size in storage elements that is a multiple of the
kono
parents:
diff changeset
449 object's ``Alignment`` (if the ``Alignment`` is nonzero)."
kono
parents:
diff changeset
450
kono
parents:
diff changeset
451 Followed.
kono
parents:
diff changeset
452
kono
parents:
diff changeset
453 RM 13.3(50-56): Size Clauses
kono
parents:
diff changeset
454 ============================
kono
parents:
diff changeset
455
kono
parents:
diff changeset
456 "If the ``Size`` of a subtype is specified, and allows for efficient
kono
parents:
diff changeset
457 independent addressability (see 9.10) on the target architecture, then
kono
parents:
diff changeset
458 the ``Size`` of the following objects of the subtype should equal the
kono
parents:
diff changeset
459 ``Size`` of the subtype:
kono
parents:
diff changeset
460
kono
parents:
diff changeset
461 Aliased objects (including components)."
kono
parents:
diff changeset
462
kono
parents:
diff changeset
463 Followed.
kono
parents:
diff changeset
464
kono
parents:
diff changeset
465 "`Size` clause on a composite subtype should not affect the
kono
parents:
diff changeset
466 internal layout of components."
kono
parents:
diff changeset
467
kono
parents:
diff changeset
468 Followed. But note that this can be overridden by use of the implementation
kono
parents:
diff changeset
469 pragma Implicit_Packing in the case of packed arrays.
kono
parents:
diff changeset
470
kono
parents:
diff changeset
471 "The recommended level of support for the ``Size`` attribute of subtypes is:
kono
parents:
diff changeset
472
kono
parents:
diff changeset
473 The ``Size`` (if not specified) of a static discrete or fixed point
kono
parents:
diff changeset
474 subtype should be the number of bits needed to represent each value
kono
parents:
diff changeset
475 belonging to the subtype using an unbiased representation, leaving space
kono
parents:
diff changeset
476 for a sign bit only if the subtype contains negative values. If such a
kono
parents:
diff changeset
477 subtype is a first subtype, then an implementation should support a
kono
parents:
diff changeset
478 specified ``Size`` for it that reflects this representation."
kono
parents:
diff changeset
479
kono
parents:
diff changeset
480 Followed.
kono
parents:
diff changeset
481
kono
parents:
diff changeset
482 "For a subtype implemented with levels of indirection, the ``Size``
kono
parents:
diff changeset
483 should include the size of the pointers, but not the size of what they
kono
parents:
diff changeset
484 point at."
kono
parents:
diff changeset
485
kono
parents:
diff changeset
486 Followed.
kono
parents:
diff changeset
487
kono
parents:
diff changeset
488 .. index:: Component_Size clauses
kono
parents:
diff changeset
489
kono
parents:
diff changeset
490 RM 13.3(71-73): Component Size Clauses
kono
parents:
diff changeset
491 ======================================
kono
parents:
diff changeset
492
kono
parents:
diff changeset
493 "The recommended level of support for the ``Component_Size``
kono
parents:
diff changeset
494 attribute is:
kono
parents:
diff changeset
495
kono
parents:
diff changeset
496 An implementation need not support specified ``Component_Sizes`` that are
kono
parents:
diff changeset
497 less than the ``Size`` of the component subtype."
kono
parents:
diff changeset
498
kono
parents:
diff changeset
499 Followed.
kono
parents:
diff changeset
500
kono
parents:
diff changeset
501 "An implementation should support specified Component_Sizes that
kono
parents:
diff changeset
502 are factors and multiples of the word size. For such
kono
parents:
diff changeset
503 Component_Sizes, the array should contain no gaps between
kono
parents:
diff changeset
504 components. For other Component_Sizes (if supported), the array
kono
parents:
diff changeset
505 should contain no gaps between components when packing is also
kono
parents:
diff changeset
506 specified; the implementation should forbid this combination in cases
kono
parents:
diff changeset
507 where it cannot support a no-gaps representation."
kono
parents:
diff changeset
508
kono
parents:
diff changeset
509 Followed.
kono
parents:
diff changeset
510
kono
parents:
diff changeset
511 .. index:: Enumeration representation clauses
kono
parents:
diff changeset
512
kono
parents:
diff changeset
513 .. index:: Representation clauses, enumeration
kono
parents:
diff changeset
514
kono
parents:
diff changeset
515 RM 13.4(9-10): Enumeration Representation Clauses
kono
parents:
diff changeset
516 =================================================
kono
parents:
diff changeset
517
kono
parents:
diff changeset
518 "The recommended level of support for enumeration representation clauses
kono
parents:
diff changeset
519 is:
kono
parents:
diff changeset
520
kono
parents:
diff changeset
521 An implementation need not support enumeration representation clauses
kono
parents:
diff changeset
522 for boolean types, but should at minimum support the internal codes in
kono
parents:
diff changeset
523 the range ``System.Min_Int .. System.Max_Int``."
kono
parents:
diff changeset
524
kono
parents:
diff changeset
525 Followed.
kono
parents:
diff changeset
526
kono
parents:
diff changeset
527 .. index:: Record representation clauses
kono
parents:
diff changeset
528
kono
parents:
diff changeset
529 .. index:: Representation clauses, records
kono
parents:
diff changeset
530
kono
parents:
diff changeset
531 RM 13.5.1(17-22): Record Representation Clauses
kono
parents:
diff changeset
532 ===============================================
kono
parents:
diff changeset
533
kono
parents:
diff changeset
534 "The recommended level of support for
kono
parents:
diff changeset
535 *record_representation_clause*\ s is:
kono
parents:
diff changeset
536
kono
parents:
diff changeset
537 An implementation should support storage places that can be extracted
kono
parents:
diff changeset
538 with a load, mask, shift sequence of machine code, and set with a load,
kono
parents:
diff changeset
539 shift, mask, store sequence, given the available machine instructions
kono
parents:
diff changeset
540 and run-time model."
kono
parents:
diff changeset
541
kono
parents:
diff changeset
542 Followed.
kono
parents:
diff changeset
543
kono
parents:
diff changeset
544 "A storage place should be supported if its size is equal to the
kono
parents:
diff changeset
545 ``Size`` of the component subtype, and it starts and ends on a
kono
parents:
diff changeset
546 boundary that obeys the ``Alignment`` of the component subtype."
kono
parents:
diff changeset
547
kono
parents:
diff changeset
548 Followed.
kono
parents:
diff changeset
549
kono
parents:
diff changeset
550 "If the default bit ordering applies to the declaration of a given type,
kono
parents:
diff changeset
551 then for a component whose subtype's ``Size`` is less than the word
kono
parents:
diff changeset
552 size, any storage place that does not cross an aligned word boundary
kono
parents:
diff changeset
553 should be supported."
kono
parents:
diff changeset
554
kono
parents:
diff changeset
555 Followed.
kono
parents:
diff changeset
556
kono
parents:
diff changeset
557 "An implementation may reserve a storage place for the tag field of a
kono
parents:
diff changeset
558 tagged type, and disallow other components from overlapping that place."
kono
parents:
diff changeset
559
kono
parents:
diff changeset
560 Followed. The storage place for the tag field is the beginning of the tagged
kono
parents:
diff changeset
561 record, and its size is Address'Size. GNAT will reject an explicit component
kono
parents:
diff changeset
562 clause for the tag field.
kono
parents:
diff changeset
563
kono
parents:
diff changeset
564 "An implementation need not support a *component_clause* for a
kono
parents:
diff changeset
565 component of an extension part if the storage place is not after the
kono
parents:
diff changeset
566 storage places of all components of the parent type, whether or not
kono
parents:
diff changeset
567 those storage places had been specified."
kono
parents:
diff changeset
568
kono
parents:
diff changeset
569 Followed. The above advice on record representation clauses is followed,
kono
parents:
diff changeset
570 and all mentioned features are implemented.
kono
parents:
diff changeset
571
kono
parents:
diff changeset
572 .. index:: Storage place attributes
kono
parents:
diff changeset
573
kono
parents:
diff changeset
574 RM 13.5.2(5): Storage Place Attributes
kono
parents:
diff changeset
575 ======================================
kono
parents:
diff changeset
576
kono
parents:
diff changeset
577 "If a component is represented using some form of pointer (such as an
kono
parents:
diff changeset
578 offset) to the actual data of the component, and this data is contiguous
kono
parents:
diff changeset
579 with the rest of the object, then the storage place attributes should
kono
parents:
diff changeset
580 reflect the place of the actual data, not the pointer. If a component is
kono
parents:
diff changeset
581 allocated discontinuously from the rest of the object, then a warning
kono
parents:
diff changeset
582 should be generated upon reference to one of its storage place
kono
parents:
diff changeset
583 attributes."
kono
parents:
diff changeset
584
kono
parents:
diff changeset
585 Followed. There are no such components in GNAT.
kono
parents:
diff changeset
586
kono
parents:
diff changeset
587 .. index:: Bit ordering
kono
parents:
diff changeset
588
kono
parents:
diff changeset
589 RM 13.5.3(7-8): Bit Ordering
kono
parents:
diff changeset
590 ============================
kono
parents:
diff changeset
591
kono
parents:
diff changeset
592 "The recommended level of support for the non-default bit ordering is:
kono
parents:
diff changeset
593
kono
parents:
diff changeset
594 If ``Word_Size`` = ``Storage_Unit``, then the implementation
kono
parents:
diff changeset
595 should support the non-default bit ordering in addition to the default
kono
parents:
diff changeset
596 bit ordering."
kono
parents:
diff changeset
597
kono
parents:
diff changeset
598 Followed. Word size does not equal storage size in this implementation.
kono
parents:
diff changeset
599 Thus non-default bit ordering is not supported.
kono
parents:
diff changeset
600
kono
parents:
diff changeset
601 .. index:: Address, as private type
kono
parents:
diff changeset
602
kono
parents:
diff changeset
603 RM 13.7(37): Address as Private
kono
parents:
diff changeset
604 ===============================
kono
parents:
diff changeset
605
kono
parents:
diff changeset
606 "`Address` should be of a private type."
kono
parents:
diff changeset
607
kono
parents:
diff changeset
608 Followed.
kono
parents:
diff changeset
609
kono
parents:
diff changeset
610 .. index:: Operations, on ``Address``
kono
parents:
diff changeset
611
kono
parents:
diff changeset
612 .. index:: Address, operations of
kono
parents:
diff changeset
613
kono
parents:
diff changeset
614 RM 13.7.1(16): Address Operations
kono
parents:
diff changeset
615 =================================
kono
parents:
diff changeset
616
kono
parents:
diff changeset
617 "Operations in ``System`` and its children should reflect the target
kono
parents:
diff changeset
618 environment semantics as closely as is reasonable. For example, on most
kono
parents:
diff changeset
619 machines, it makes sense for address arithmetic to 'wrap around'.
kono
parents:
diff changeset
620 Operations that do not make sense should raise ``Program_Error``."
kono
parents:
diff changeset
621
kono
parents:
diff changeset
622 Followed. Address arithmetic is modular arithmetic that wraps around. No
kono
parents:
diff changeset
623 operation raises ``Program_Error``, since all operations make sense.
kono
parents:
diff changeset
624
kono
parents:
diff changeset
625 .. index:: Unchecked conversion
kono
parents:
diff changeset
626
kono
parents:
diff changeset
627 RM 13.9(14-17): Unchecked Conversion
kono
parents:
diff changeset
628 ====================================
kono
parents:
diff changeset
629
kono
parents:
diff changeset
630 "The ``Size`` of an array object should not include its bounds; hence,
kono
parents:
diff changeset
631 the bounds should not be part of the converted data."
kono
parents:
diff changeset
632
kono
parents:
diff changeset
633 Followed.
kono
parents:
diff changeset
634
kono
parents:
diff changeset
635 "The implementation should not generate unnecessary run-time checks to
kono
parents:
diff changeset
636 ensure that the representation of ``S`` is a representation of the
kono
parents:
diff changeset
637 target type. It should take advantage of the permission to return by
kono
parents:
diff changeset
638 reference when possible. Restrictions on unchecked conversions should be
kono
parents:
diff changeset
639 avoided unless required by the target environment."
kono
parents:
diff changeset
640
kono
parents:
diff changeset
641 Followed. There are no restrictions on unchecked conversion. A warning is
kono
parents:
diff changeset
642 generated if the source and target types do not have the same size since
kono
parents:
diff changeset
643 the semantics in this case may be target dependent.
kono
parents:
diff changeset
644
kono
parents:
diff changeset
645 "The recommended level of support for unchecked conversions is:
kono
parents:
diff changeset
646
kono
parents:
diff changeset
647 Unchecked conversions should be supported and should be reversible in
kono
parents:
diff changeset
648 the cases where this clause defines the result. To enable meaningful use
kono
parents:
diff changeset
649 of unchecked conversion, a contiguous representation should be used for
kono
parents:
diff changeset
650 elementary subtypes, for statically constrained array subtypes whose
kono
parents:
diff changeset
651 component subtype is one of the subtypes described in this paragraph,
kono
parents:
diff changeset
652 and for record subtypes without discriminants whose component subtypes
kono
parents:
diff changeset
653 are described in this paragraph."
kono
parents:
diff changeset
654
kono
parents:
diff changeset
655 Followed.
kono
parents:
diff changeset
656
kono
parents:
diff changeset
657 .. index:: Heap usage, implicit
kono
parents:
diff changeset
658
kono
parents:
diff changeset
659 RM 13.11(23-25): Implicit Heap Usage
kono
parents:
diff changeset
660 ====================================
kono
parents:
diff changeset
661
kono
parents:
diff changeset
662 "An implementation should document any cases in which it dynamically
kono
parents:
diff changeset
663 allocates heap storage for a purpose other than the evaluation of an
kono
parents:
diff changeset
664 allocator."
kono
parents:
diff changeset
665
kono
parents:
diff changeset
666 Followed, the only other points at which heap storage is dynamically
kono
parents:
diff changeset
667 allocated are as follows:
kono
parents:
diff changeset
668
kono
parents:
diff changeset
669 *
kono
parents:
diff changeset
670 At initial elaboration time, to allocate dynamically sized global
kono
parents:
diff changeset
671 objects.
kono
parents:
diff changeset
672
kono
parents:
diff changeset
673 *
kono
parents:
diff changeset
674 To allocate space for a task when a task is created.
kono
parents:
diff changeset
675
kono
parents:
diff changeset
676 *
kono
parents:
diff changeset
677 To extend the secondary stack dynamically when needed. The secondary
kono
parents:
diff changeset
678 stack is used for returning variable length results.
kono
parents:
diff changeset
679
kono
parents:
diff changeset
680 ..
kono
parents:
diff changeset
681
kono
parents:
diff changeset
682 "A default (implementation-provided) storage pool for an
kono
parents:
diff changeset
683 access-to-constant type should not have overhead to support deallocation of
kono
parents:
diff changeset
684 individual objects."
kono
parents:
diff changeset
685
kono
parents:
diff changeset
686 Followed.
kono
parents:
diff changeset
687
kono
parents:
diff changeset
688 "A storage pool for an anonymous access type should be created at the
kono
parents:
diff changeset
689 point of an allocator for the type, and be reclaimed when the designated
kono
parents:
diff changeset
690 object becomes inaccessible."
kono
parents:
diff changeset
691
kono
parents:
diff changeset
692 Followed.
kono
parents:
diff changeset
693
kono
parents:
diff changeset
694 .. index:: Unchecked deallocation
kono
parents:
diff changeset
695
kono
parents:
diff changeset
696 RM 13.11.2(17): Unchecked Deallocation
kono
parents:
diff changeset
697 ======================================
kono
parents:
diff changeset
698
kono
parents:
diff changeset
699 "For a standard storage pool, ``Free`` should actually reclaim the
kono
parents:
diff changeset
700 storage."
kono
parents:
diff changeset
701
kono
parents:
diff changeset
702 Followed.
kono
parents:
diff changeset
703
kono
parents:
diff changeset
704 .. index:: Stream oriented attributes
kono
parents:
diff changeset
705
kono
parents:
diff changeset
706 RM 13.13.2(17): Stream Oriented Attributes
kono
parents:
diff changeset
707 ==========================================
kono
parents:
diff changeset
708
kono
parents:
diff changeset
709 "If a stream element is the same size as a storage element, then the
kono
parents:
diff changeset
710 normal in-memory representation should be used by ``Read`` and
kono
parents:
diff changeset
711 ``Write`` for scalar objects. Otherwise, ``Read`` and ``Write``
kono
parents:
diff changeset
712 should use the smallest number of stream elements needed to represent
kono
parents:
diff changeset
713 all values in the base range of the scalar type."
kono
parents:
diff changeset
714
kono
parents:
diff changeset
715 Followed. By default, GNAT uses the interpretation suggested by AI-195,
kono
parents:
diff changeset
716 which specifies using the size of the first subtype.
kono
parents:
diff changeset
717 However, such an implementation is based on direct binary
kono
parents:
diff changeset
718 representations and is therefore target- and endianness-dependent.
kono
parents:
diff changeset
719 To address this issue, GNAT also supplies an alternate implementation
kono
parents:
diff changeset
720 of the stream attributes ``Read`` and ``Write``,
kono
parents:
diff changeset
721 which uses the target-independent XDR standard representation
kono
parents:
diff changeset
722 for scalar types.
kono
parents:
diff changeset
723
kono
parents:
diff changeset
724 .. index:: XDR representation
kono
parents:
diff changeset
725
kono
parents:
diff changeset
726 .. index:: Read attribute
kono
parents:
diff changeset
727
kono
parents:
diff changeset
728 .. index:: Write attribute
kono
parents:
diff changeset
729
kono
parents:
diff changeset
730 .. index:: Stream oriented attributes
kono
parents:
diff changeset
731
kono
parents:
diff changeset
732 The XDR implementation is provided as an alternative body of the
kono
parents:
diff changeset
733 ``System.Stream_Attributes`` package, in the file
kono
parents:
diff changeset
734 :file:`s-stratt-xdr.adb` in the GNAT library.
kono
parents:
diff changeset
735 There is no :file:`s-stratt-xdr.ads` file.
kono
parents:
diff changeset
736 In order to install the XDR implementation, do the following:
kono
parents:
diff changeset
737
kono
parents:
diff changeset
738 * Replace the default implementation of the
kono
parents:
diff changeset
739 ``System.Stream_Attributes`` package with the XDR implementation.
kono
parents:
diff changeset
740 For example on a Unix platform issue the commands:
kono
parents:
diff changeset
741
kono
parents:
diff changeset
742 .. code-block:: sh
kono
parents:
diff changeset
743
kono
parents:
diff changeset
744 $ mv s-stratt.adb s-stratt-default.adb
kono
parents:
diff changeset
745 $ mv s-stratt-xdr.adb s-stratt.adb
kono
parents:
diff changeset
746
kono
parents:
diff changeset
747
kono
parents:
diff changeset
748 *
kono
parents:
diff changeset
749 Rebuild the GNAT run-time library as documented in
kono
parents:
diff changeset
750 the *GNAT and Libraries* section of the :title:`GNAT User's Guide`.
kono
parents:
diff changeset
751
kono
parents:
diff changeset
752 RM A.1(52): Names of Predefined Numeric Types
kono
parents:
diff changeset
753 =============================================
kono
parents:
diff changeset
754
kono
parents:
diff changeset
755 "If an implementation provides additional named predefined integer types,
kono
parents:
diff changeset
756 then the names should end with ``Integer`` as in
kono
parents:
diff changeset
757 ``Long_Integer``. If an implementation provides additional named
kono
parents:
diff changeset
758 predefined floating point types, then the names should end with
kono
parents:
diff changeset
759 ``Float`` as in ``Long_Float``."
kono
parents:
diff changeset
760
kono
parents:
diff changeset
761 Followed.
kono
parents:
diff changeset
762
kono
parents:
diff changeset
763 .. index:: Ada.Characters.Handling
kono
parents:
diff changeset
764
kono
parents:
diff changeset
765 RM A.3.2(49): ``Ada.Characters.Handling``
kono
parents:
diff changeset
766 =========================================
kono
parents:
diff changeset
767
kono
parents:
diff changeset
768 "If an implementation provides a localized definition of ``Character``
kono
parents:
diff changeset
769 or ``Wide_Character``, then the effects of the subprograms in
kono
parents:
diff changeset
770 ``Characters.Handling`` should reflect the localizations.
kono
parents:
diff changeset
771 See also 3.5.2."
kono
parents:
diff changeset
772
kono
parents:
diff changeset
773 Followed. GNAT provides no such localized definitions.
kono
parents:
diff changeset
774
kono
parents:
diff changeset
775 .. index:: Bounded-length strings
kono
parents:
diff changeset
776
kono
parents:
diff changeset
777 RM A.4.4(106): Bounded-Length String Handling
kono
parents:
diff changeset
778 =============================================
kono
parents:
diff changeset
779
kono
parents:
diff changeset
780 "Bounded string objects should not be implemented by implicit pointers
kono
parents:
diff changeset
781 and dynamic allocation."
kono
parents:
diff changeset
782
kono
parents:
diff changeset
783 Followed. No implicit pointers or dynamic allocation are used.
kono
parents:
diff changeset
784
kono
parents:
diff changeset
785 .. index:: Random number generation
kono
parents:
diff changeset
786
kono
parents:
diff changeset
787 RM A.5.2(46-47): Random Number Generation
kono
parents:
diff changeset
788 =========================================
kono
parents:
diff changeset
789
kono
parents:
diff changeset
790 "Any storage associated with an object of type ``Generator`` should be
kono
parents:
diff changeset
791 reclaimed on exit from the scope of the object."
kono
parents:
diff changeset
792
kono
parents:
diff changeset
793 Followed.
kono
parents:
diff changeset
794
kono
parents:
diff changeset
795 "If the generator period is sufficiently long in relation to the number
kono
parents:
diff changeset
796 of distinct initiator values, then each possible value of
kono
parents:
diff changeset
797 ``Initiator`` passed to ``Reset`` should initiate a sequence of
kono
parents:
diff changeset
798 random numbers that does not, in a practical sense, overlap the sequence
kono
parents:
diff changeset
799 initiated by any other value. If this is not possible, then the mapping
kono
parents:
diff changeset
800 between initiator values and generator states should be a rapidly
kono
parents:
diff changeset
801 varying function of the initiator value."
kono
parents:
diff changeset
802
kono
parents:
diff changeset
803 Followed. The generator period is sufficiently long for the first
kono
parents:
diff changeset
804 condition here to hold true.
kono
parents:
diff changeset
805
kono
parents:
diff changeset
806 .. index:: Get_Immediate
kono
parents:
diff changeset
807
kono
parents:
diff changeset
808 RM A.10.7(23): ``Get_Immediate``
kono
parents:
diff changeset
809 ================================
kono
parents:
diff changeset
810
kono
parents:
diff changeset
811 "The ``Get_Immediate`` procedures should be implemented with
kono
parents:
diff changeset
812 unbuffered input. For a device such as a keyboard, input should be
kono
parents:
diff changeset
813 available if a key has already been typed, whereas for a disk
kono
parents:
diff changeset
814 file, input should always be available except at end of file. For a file
kono
parents:
diff changeset
815 associated with a keyboard-like device, any line-editing features of the
kono
parents:
diff changeset
816 underlying operating system should be disabled during the execution of
kono
parents:
diff changeset
817 ``Get_Immediate``."
kono
parents:
diff changeset
818
kono
parents:
diff changeset
819 Followed on all targets except VxWorks. For VxWorks, there is no way to
kono
parents:
diff changeset
820 provide this functionality that does not result in the input buffer being
kono
parents:
diff changeset
821 flushed before the ``Get_Immediate`` call. A special unit
kono
parents:
diff changeset
822 ``Interfaces.Vxworks.IO`` is provided that contains routines to enable
kono
parents:
diff changeset
823 this functionality.
kono
parents:
diff changeset
824
kono
parents:
diff changeset
825 .. index:: Export
kono
parents:
diff changeset
826
kono
parents:
diff changeset
827 RM B.1(39-41): Pragma ``Export``
kono
parents:
diff changeset
828 ================================
kono
parents:
diff changeset
829
kono
parents:
diff changeset
830 "If an implementation supports pragma ``Export`` to a given language,
kono
parents:
diff changeset
831 then it should also allow the main subprogram to be written in that
kono
parents:
diff changeset
832 language. It should support some mechanism for invoking the elaboration
kono
parents:
diff changeset
833 of the Ada library units included in the system, and for invoking the
kono
parents:
diff changeset
834 finalization of the environment task. On typical systems, the
kono
parents:
diff changeset
835 recommended mechanism is to provide two subprograms whose link names are
kono
parents:
diff changeset
836 ``adainit`` and ``adafinal``. ``adainit`` should contain the
kono
parents:
diff changeset
837 elaboration code for library units. ``adafinal`` should contain the
kono
parents:
diff changeset
838 finalization code. These subprograms should have no effect the second
kono
parents:
diff changeset
839 and subsequent time they are called."
kono
parents:
diff changeset
840
kono
parents:
diff changeset
841 Followed.
kono
parents:
diff changeset
842
kono
parents:
diff changeset
843 "Automatic elaboration of pre-elaborated packages should be
kono
parents:
diff changeset
844 provided when pragma ``Export`` is supported."
kono
parents:
diff changeset
845
kono
parents:
diff changeset
846 Followed when the main program is in Ada. If the main program is in a
kono
parents:
diff changeset
847 foreign language, then
kono
parents:
diff changeset
848 ``adainit`` must be called to elaborate pre-elaborated
kono
parents:
diff changeset
849 packages.
kono
parents:
diff changeset
850
kono
parents:
diff changeset
851 "For each supported convention *L* other than ``Intrinsic``, an
kono
parents:
diff changeset
852 implementation should support ``Import`` and ``Export`` pragmas
kono
parents:
diff changeset
853 for objects of *L*\ -compatible types and for subprograms, and pragma
kono
parents:
diff changeset
854 `Convention` for *L*\ -eligible types and for subprograms,
kono
parents:
diff changeset
855 presuming the other language has corresponding features. Pragma
kono
parents:
diff changeset
856 ``Convention`` need not be supported for scalar types."
kono
parents:
diff changeset
857
kono
parents:
diff changeset
858 Followed.
kono
parents:
diff changeset
859
kono
parents:
diff changeset
860 .. index:: Package Interfaces
kono
parents:
diff changeset
861
kono
parents:
diff changeset
862 .. index:: Interfaces
kono
parents:
diff changeset
863
kono
parents:
diff changeset
864 RM B.2(12-13): Package ``Interfaces``
kono
parents:
diff changeset
865 =====================================
kono
parents:
diff changeset
866
kono
parents:
diff changeset
867 "For each implementation-defined convention identifier, there should be a
kono
parents:
diff changeset
868 child package of package Interfaces with the corresponding name. This
kono
parents:
diff changeset
869 package should contain any declarations that would be useful for
kono
parents:
diff changeset
870 interfacing to the language (implementation) represented by the
kono
parents:
diff changeset
871 convention. Any declarations useful for interfacing to any language on
kono
parents:
diff changeset
872 the given hardware architecture should be provided directly in
kono
parents:
diff changeset
873 ``Interfaces``."
kono
parents:
diff changeset
874
kono
parents:
diff changeset
875 Followed.
kono
parents:
diff changeset
876
kono
parents:
diff changeset
877 "An implementation supporting an interface to C, COBOL, or Fortran should
kono
parents:
diff changeset
878 provide the corresponding package or packages described in the following
kono
parents:
diff changeset
879 clauses."
kono
parents:
diff changeset
880
kono
parents:
diff changeset
881 Followed. GNAT provides all the packages described in this section.
kono
parents:
diff changeset
882
kono
parents:
diff changeset
883 .. index:: C, interfacing with
kono
parents:
diff changeset
884
kono
parents:
diff changeset
885 RM B.3(63-71): Interfacing with C
kono
parents:
diff changeset
886 =================================
kono
parents:
diff changeset
887
kono
parents:
diff changeset
888 "An implementation should support the following interface correspondences
kono
parents:
diff changeset
889 between Ada and C."
kono
parents:
diff changeset
890
kono
parents:
diff changeset
891 Followed.
kono
parents:
diff changeset
892
kono
parents:
diff changeset
893 "An Ada procedure corresponds to a void-returning C function."
kono
parents:
diff changeset
894
kono
parents:
diff changeset
895 Followed.
kono
parents:
diff changeset
896
kono
parents:
diff changeset
897 "An Ada function corresponds to a non-void C function."
kono
parents:
diff changeset
898
kono
parents:
diff changeset
899 Followed.
kono
parents:
diff changeset
900
kono
parents:
diff changeset
901 "An Ada ``in`` scalar parameter is passed as a scalar argument to a C
kono
parents:
diff changeset
902 function."
kono
parents:
diff changeset
903
kono
parents:
diff changeset
904 Followed.
kono
parents:
diff changeset
905
kono
parents:
diff changeset
906 "An Ada ``in`` parameter of an access-to-object type with designated
kono
parents:
diff changeset
907 type ``T`` is passed as a ``t*`` argument to a C function,
kono
parents:
diff changeset
908 where ``t`` is the C type corresponding to the Ada type ``T``."
kono
parents:
diff changeset
909
kono
parents:
diff changeset
910 Followed.
kono
parents:
diff changeset
911
kono
parents:
diff changeset
912 "An Ada access ``T`` parameter, or an Ada ``out`` or ``in out``
kono
parents:
diff changeset
913 parameter of an elementary type ``T``, is passed as a ``t*``
kono
parents:
diff changeset
914 argument to a C function, where ``t`` is the C type corresponding to
kono
parents:
diff changeset
915 the Ada type ``T``. In the case of an elementary ``out`` or
kono
parents:
diff changeset
916 ``in out`` parameter, a pointer to a temporary copy is used to
kono
parents:
diff changeset
917 preserve by-copy semantics."
kono
parents:
diff changeset
918
kono
parents:
diff changeset
919 Followed.
kono
parents:
diff changeset
920
kono
parents:
diff changeset
921 "An Ada parameter of a record type ``T``, of any mode, is passed as a
kono
parents:
diff changeset
922 ``t*`` argument to a C function, where ``t`` is the C
kono
parents:
diff changeset
923 structure corresponding to the Ada type ``T``."
kono
parents:
diff changeset
924
kono
parents:
diff changeset
925 Followed. This convention may be overridden by the use of the C_Pass_By_Copy
kono
parents:
diff changeset
926 pragma, or Convention, or by explicitly specifying the mechanism for a given
kono
parents:
diff changeset
927 call using an extended import or export pragma.
kono
parents:
diff changeset
928
kono
parents:
diff changeset
929 "An Ada parameter of an array type with component type ``T``, of any
kono
parents:
diff changeset
930 mode, is passed as a ``t*`` argument to a C function, where
kono
parents:
diff changeset
931 ``t`` is the C type corresponding to the Ada type ``T``."
kono
parents:
diff changeset
932
kono
parents:
diff changeset
933 Followed.
kono
parents:
diff changeset
934
kono
parents:
diff changeset
935 "An Ada parameter of an access-to-subprogram type is passed as a pointer
kono
parents:
diff changeset
936 to a C function whose prototype corresponds to the designated
kono
parents:
diff changeset
937 subprogram's specification."
kono
parents:
diff changeset
938
kono
parents:
diff changeset
939 Followed.
kono
parents:
diff changeset
940
kono
parents:
diff changeset
941 .. index:: COBOL, interfacing with
kono
parents:
diff changeset
942
kono
parents:
diff changeset
943 RM B.4(95-98): Interfacing with COBOL
kono
parents:
diff changeset
944 =====================================
kono
parents:
diff changeset
945
kono
parents:
diff changeset
946 "An Ada implementation should support the following interface
kono
parents:
diff changeset
947 correspondences between Ada and COBOL."
kono
parents:
diff changeset
948
kono
parents:
diff changeset
949 Followed.
kono
parents:
diff changeset
950
kono
parents:
diff changeset
951 "An Ada access ``T`` parameter is passed as a ``BY REFERENCE`` data item of
kono
parents:
diff changeset
952 the COBOL type corresponding to ``T``."
kono
parents:
diff changeset
953
kono
parents:
diff changeset
954 Followed.
kono
parents:
diff changeset
955
kono
parents:
diff changeset
956 "An Ada in scalar parameter is passed as a ``BY CONTENT`` data item of
kono
parents:
diff changeset
957 the corresponding COBOL type."
kono
parents:
diff changeset
958
kono
parents:
diff changeset
959 Followed.
kono
parents:
diff changeset
960
kono
parents:
diff changeset
961 "Any other Ada parameter is passed as a ``BY REFERENCE`` data item of the
kono
parents:
diff changeset
962 COBOL type corresponding to the Ada parameter type; for scalars, a local
kono
parents:
diff changeset
963 copy is used if necessary to ensure by-copy semantics."
kono
parents:
diff changeset
964
kono
parents:
diff changeset
965 Followed.
kono
parents:
diff changeset
966
kono
parents:
diff changeset
967 .. index:: Fortran, interfacing with
kono
parents:
diff changeset
968
kono
parents:
diff changeset
969 RM B.5(22-26): Interfacing with Fortran
kono
parents:
diff changeset
970 =======================================
kono
parents:
diff changeset
971
kono
parents:
diff changeset
972 "An Ada implementation should support the following interface
kono
parents:
diff changeset
973 correspondences between Ada and Fortran:"
kono
parents:
diff changeset
974
kono
parents:
diff changeset
975 Followed.
kono
parents:
diff changeset
976
kono
parents:
diff changeset
977 "An Ada procedure corresponds to a Fortran subroutine."
kono
parents:
diff changeset
978
kono
parents:
diff changeset
979 Followed.
kono
parents:
diff changeset
980
kono
parents:
diff changeset
981 "An Ada function corresponds to a Fortran function."
kono
parents:
diff changeset
982
kono
parents:
diff changeset
983 Followed.
kono
parents:
diff changeset
984
kono
parents:
diff changeset
985 "An Ada parameter of an elementary, array, or record type ``T`` is
kono
parents:
diff changeset
986 passed as a ``T`` argument to a Fortran procedure, where ``T`` is
kono
parents:
diff changeset
987 the Fortran type corresponding to the Ada type ``T``, and where the
kono
parents:
diff changeset
988 INTENT attribute of the corresponding dummy argument matches the Ada
kono
parents:
diff changeset
989 formal parameter mode; the Fortran implementation's parameter passing
kono
parents:
diff changeset
990 conventions are used. For elementary types, a local copy is used if
kono
parents:
diff changeset
991 necessary to ensure by-copy semantics."
kono
parents:
diff changeset
992
kono
parents:
diff changeset
993 Followed.
kono
parents:
diff changeset
994
kono
parents:
diff changeset
995 "An Ada parameter of an access-to-subprogram type is passed as a
kono
parents:
diff changeset
996 reference to a Fortran procedure whose interface corresponds to the
kono
parents:
diff changeset
997 designated subprogram's specification."
kono
parents:
diff changeset
998
kono
parents:
diff changeset
999 Followed.
kono
parents:
diff changeset
1000
kono
parents:
diff changeset
1001 .. index:: Machine operations
kono
parents:
diff changeset
1002
kono
parents:
diff changeset
1003 RM C.1(3-5): Access to Machine Operations
kono
parents:
diff changeset
1004 =========================================
kono
parents:
diff changeset
1005
kono
parents:
diff changeset
1006 "The machine code or intrinsic support should allow access to all
kono
parents:
diff changeset
1007 operations normally available to assembly language programmers for the
kono
parents:
diff changeset
1008 target environment, including privileged instructions, if any."
kono
parents:
diff changeset
1009
kono
parents:
diff changeset
1010 Followed.
kono
parents:
diff changeset
1011
kono
parents:
diff changeset
1012 "The interfacing pragmas (see Annex B) should support interface to
kono
parents:
diff changeset
1013 assembler; the default assembler should be associated with the
kono
parents:
diff changeset
1014 convention identifier ``Assembler``."
kono
parents:
diff changeset
1015
kono
parents:
diff changeset
1016 Followed.
kono
parents:
diff changeset
1017
kono
parents:
diff changeset
1018 "If an entity is exported to assembly language, then the implementation
kono
parents:
diff changeset
1019 should allocate it at an addressable location, and should ensure that it
kono
parents:
diff changeset
1020 is retained by the linking process, even if not otherwise referenced
kono
parents:
diff changeset
1021 from the Ada code. The implementation should assume that any call to a
kono
parents:
diff changeset
1022 machine code or assembler subprogram is allowed to read or update every
kono
parents:
diff changeset
1023 object that is specified as exported."
kono
parents:
diff changeset
1024
kono
parents:
diff changeset
1025 Followed.
kono
parents:
diff changeset
1026
kono
parents:
diff changeset
1027 RM C.1(10-16): Access to Machine Operations
kono
parents:
diff changeset
1028 ===========================================
kono
parents:
diff changeset
1029
kono
parents:
diff changeset
1030 "The implementation should ensure that little or no overhead is
kono
parents:
diff changeset
1031 associated with calling intrinsic and machine-code subprograms."
kono
parents:
diff changeset
1032
kono
parents:
diff changeset
1033 Followed for both intrinsics and machine-code subprograms.
kono
parents:
diff changeset
1034
kono
parents:
diff changeset
1035 "It is recommended that intrinsic subprograms be provided for convenient
kono
parents:
diff changeset
1036 access to any machine operations that provide special capabilities or
kono
parents:
diff changeset
1037 efficiency and that are not otherwise available through the language
kono
parents:
diff changeset
1038 constructs."
kono
parents:
diff changeset
1039
kono
parents:
diff changeset
1040 Followed. A full set of machine operation intrinsic subprograms is provided.
kono
parents:
diff changeset
1041
kono
parents:
diff changeset
1042 "Atomic read-modify-write operations---e.g., test and set, compare and
kono
parents:
diff changeset
1043 swap, decrement and test, enqueue/dequeue."
kono
parents:
diff changeset
1044
kono
parents:
diff changeset
1045 Followed on any target supporting such operations.
kono
parents:
diff changeset
1046
kono
parents:
diff changeset
1047 "Standard numeric functions---e.g.:, sin, log."
kono
parents:
diff changeset
1048
kono
parents:
diff changeset
1049 Followed on any target supporting such operations.
kono
parents:
diff changeset
1050
kono
parents:
diff changeset
1051 "String manipulation operations---e.g.:, translate and test."
kono
parents:
diff changeset
1052
kono
parents:
diff changeset
1053 Followed on any target supporting such operations.
kono
parents:
diff changeset
1054
kono
parents:
diff changeset
1055 "Vector operations---e.g.:, compare vector against thresholds."
kono
parents:
diff changeset
1056
kono
parents:
diff changeset
1057 Followed on any target supporting such operations.
kono
parents:
diff changeset
1058
kono
parents:
diff changeset
1059 "Direct operations on I/O ports."
kono
parents:
diff changeset
1060
kono
parents:
diff changeset
1061 Followed on any target supporting such operations.
kono
parents:
diff changeset
1062
kono
parents:
diff changeset
1063 .. index:: Interrupt support
kono
parents:
diff changeset
1064
kono
parents:
diff changeset
1065 RM C.3(28): Interrupt Support
kono
parents:
diff changeset
1066 =============================
kono
parents:
diff changeset
1067
kono
parents:
diff changeset
1068 "If the ``Ceiling_Locking`` policy is not in effect, the
kono
parents:
diff changeset
1069 implementation should provide means for the application to specify which
kono
parents:
diff changeset
1070 interrupts are to be blocked during protected actions, if the underlying
kono
parents:
diff changeset
1071 system allows for a finer-grain control of interrupt blocking."
kono
parents:
diff changeset
1072
kono
parents:
diff changeset
1073 Followed. The underlying system does not allow for finer-grain control
kono
parents:
diff changeset
1074 of interrupt blocking.
kono
parents:
diff changeset
1075
kono
parents:
diff changeset
1076 .. index:: Protected procedure handlers
kono
parents:
diff changeset
1077
kono
parents:
diff changeset
1078 RM C.3.1(20-21): Protected Procedure Handlers
kono
parents:
diff changeset
1079 =============================================
kono
parents:
diff changeset
1080
kono
parents:
diff changeset
1081 "Whenever possible, the implementation should allow interrupt handlers to
kono
parents:
diff changeset
1082 be called directly by the hardware."
kono
parents:
diff changeset
1083
kono
parents:
diff changeset
1084 Followed on any target where the underlying operating system permits
kono
parents:
diff changeset
1085 such direct calls.
kono
parents:
diff changeset
1086
kono
parents:
diff changeset
1087 "Whenever practical, violations of any
kono
parents:
diff changeset
1088 implementation-defined restrictions should be detected before run time."
kono
parents:
diff changeset
1089
kono
parents:
diff changeset
1090 Followed. Compile time warnings are given when possible.
kono
parents:
diff changeset
1091
kono
parents:
diff changeset
1092 .. index:: Package ``Interrupts``
kono
parents:
diff changeset
1093
kono
parents:
diff changeset
1094 .. index:: Interrupts
kono
parents:
diff changeset
1095
kono
parents:
diff changeset
1096 RM C.3.2(25): Package ``Interrupts``
kono
parents:
diff changeset
1097 ====================================
kono
parents:
diff changeset
1098
kono
parents:
diff changeset
1099 "If implementation-defined forms of interrupt handler procedures are
kono
parents:
diff changeset
1100 supported, such as protected procedures with parameters, then for each
kono
parents:
diff changeset
1101 such form of a handler, a type analogous to ``Parameterless_Handler``
kono
parents:
diff changeset
1102 should be specified in a child package of ``Interrupts``, with the
kono
parents:
diff changeset
1103 same operations as in the predefined package Interrupts."
kono
parents:
diff changeset
1104
kono
parents:
diff changeset
1105 Followed.
kono
parents:
diff changeset
1106
kono
parents:
diff changeset
1107 .. index:: Pre-elaboration requirements
kono
parents:
diff changeset
1108
kono
parents:
diff changeset
1109 RM C.4(14): Pre-elaboration Requirements
kono
parents:
diff changeset
1110 ========================================
kono
parents:
diff changeset
1111
kono
parents:
diff changeset
1112 "It is recommended that pre-elaborated packages be implemented in such a
kono
parents:
diff changeset
1113 way that there should be little or no code executed at run time for the
kono
parents:
diff changeset
1114 elaboration of entities not already covered by the Implementation
kono
parents:
diff changeset
1115 Requirements."
kono
parents:
diff changeset
1116
kono
parents:
diff changeset
1117 Followed. Executable code is generated in some cases, e.g., loops
kono
parents:
diff changeset
1118 to initialize large arrays.
kono
parents:
diff changeset
1119
kono
parents:
diff changeset
1120 RM C.5(8): Pragma ``Discard_Names``
kono
parents:
diff changeset
1121 ===================================
kono
parents:
diff changeset
1122
kono
parents:
diff changeset
1123 "If the pragma applies to an entity, then the implementation should
kono
parents:
diff changeset
1124 reduce the amount of storage used for storing names associated with that
kono
parents:
diff changeset
1125 entity."
kono
parents:
diff changeset
1126
kono
parents:
diff changeset
1127 Followed.
kono
parents:
diff changeset
1128
kono
parents:
diff changeset
1129 .. index:: Package Task_Attributes
kono
parents:
diff changeset
1130
kono
parents:
diff changeset
1131 .. index:: Task_Attributes
kono
parents:
diff changeset
1132
kono
parents:
diff changeset
1133 RM C.7.2(30): The Package Task_Attributes
kono
parents:
diff changeset
1134 =========================================
kono
parents:
diff changeset
1135
kono
parents:
diff changeset
1136 "Some implementations are targeted to domains in which memory use at run
kono
parents:
diff changeset
1137 time must be completely deterministic. For such implementations, it is
kono
parents:
diff changeset
1138 recommended that the storage for task attributes will be pre-allocated
kono
parents:
diff changeset
1139 statically and not from the heap. This can be accomplished by either
kono
parents:
diff changeset
1140 placing restrictions on the number and the size of the task's
kono
parents:
diff changeset
1141 attributes, or by using the pre-allocated storage for the first ``N``
kono
parents:
diff changeset
1142 attribute objects, and the heap for the others. In the latter case,
kono
parents:
diff changeset
1143 ``N`` should be documented."
kono
parents:
diff changeset
1144
kono
parents:
diff changeset
1145 Not followed. This implementation is not targeted to such a domain.
kono
parents:
diff changeset
1146
kono
parents:
diff changeset
1147 .. index:: Locking Policies
kono
parents:
diff changeset
1148
kono
parents:
diff changeset
1149 RM D.3(17): Locking Policies
kono
parents:
diff changeset
1150 ============================
kono
parents:
diff changeset
1151
kono
parents:
diff changeset
1152 "The implementation should use names that end with ``_Locking`` for
kono
parents:
diff changeset
1153 locking policies defined by the implementation."
kono
parents:
diff changeset
1154
kono
parents:
diff changeset
1155 Followed. Two implementation-defined locking policies are defined,
kono
parents:
diff changeset
1156 whose names (``Inheritance_Locking`` and
kono
parents:
diff changeset
1157 ``Concurrent_Readers_Locking``) follow this suggestion.
kono
parents:
diff changeset
1158
kono
parents:
diff changeset
1159 .. index:: Entry queuing policies
kono
parents:
diff changeset
1160
kono
parents:
diff changeset
1161 RM D.4(16): Entry Queuing Policies
kono
parents:
diff changeset
1162 ==================================
kono
parents:
diff changeset
1163
kono
parents:
diff changeset
1164 "Names that end with ``_Queuing`` should be used
kono
parents:
diff changeset
1165 for all implementation-defined queuing policies."
kono
parents:
diff changeset
1166
kono
parents:
diff changeset
1167 Followed. No such implementation-defined queuing policies exist.
kono
parents:
diff changeset
1168
kono
parents:
diff changeset
1169 .. index:: Preemptive abort
kono
parents:
diff changeset
1170
kono
parents:
diff changeset
1171 RM D.6(9-10): Preemptive Abort
kono
parents:
diff changeset
1172 ==============================
kono
parents:
diff changeset
1173
kono
parents:
diff changeset
1174 "Even though the *abort_statement* is included in the list of
kono
parents:
diff changeset
1175 potentially blocking operations (see 9.5.1), it is recommended that this
kono
parents:
diff changeset
1176 statement be implemented in a way that never requires the task executing
kono
parents:
diff changeset
1177 the *abort_statement* to block."
kono
parents:
diff changeset
1178
kono
parents:
diff changeset
1179 Followed.
kono
parents:
diff changeset
1180
kono
parents:
diff changeset
1181 "On a multi-processor, the delay associated with aborting a task on
kono
parents:
diff changeset
1182 another processor should be bounded; the implementation should use
kono
parents:
diff changeset
1183 periodic polling, if necessary, to achieve this."
kono
parents:
diff changeset
1184
kono
parents:
diff changeset
1185 Followed.
kono
parents:
diff changeset
1186
kono
parents:
diff changeset
1187 .. index:: Tasking restrictions
kono
parents:
diff changeset
1188
kono
parents:
diff changeset
1189 RM D.7(21): Tasking Restrictions
kono
parents:
diff changeset
1190 ================================
kono
parents:
diff changeset
1191
kono
parents:
diff changeset
1192 "When feasible, the implementation should take advantage of the specified
kono
parents:
diff changeset
1193 restrictions to produce a more efficient implementation."
kono
parents:
diff changeset
1194
kono
parents:
diff changeset
1195 GNAT currently takes advantage of these restrictions by providing an optimized
kono
parents:
diff changeset
1196 run time when the Ravenscar profile and the GNAT restricted run time set
kono
parents:
diff changeset
1197 of restrictions are specified. See pragma ``Profile (Ravenscar)`` and
kono
parents:
diff changeset
1198 pragma ``Profile (Restricted)`` for more details.
kono
parents:
diff changeset
1199
kono
parents:
diff changeset
1200 .. index:: Time, monotonic
kono
parents:
diff changeset
1201
kono
parents:
diff changeset
1202 RM D.8(47-49): Monotonic Time
kono
parents:
diff changeset
1203 =============================
kono
parents:
diff changeset
1204
kono
parents:
diff changeset
1205 "When appropriate, implementations should provide configuration
kono
parents:
diff changeset
1206 mechanisms to change the value of ``Tick``."
kono
parents:
diff changeset
1207
kono
parents:
diff changeset
1208 Such configuration mechanisms are not appropriate to this implementation
kono
parents:
diff changeset
1209 and are thus not supported.
kono
parents:
diff changeset
1210
kono
parents:
diff changeset
1211 "It is recommended that ``Calendar.Clock`` and ``Real_Time.Clock``
kono
parents:
diff changeset
1212 be implemented as transformations of the same time base."
kono
parents:
diff changeset
1213
kono
parents:
diff changeset
1214 Followed.
kono
parents:
diff changeset
1215
kono
parents:
diff changeset
1216
kono
parents:
diff changeset
1217 "It is recommended that the best time base which exists in
kono
parents:
diff changeset
1218 the underlying system be available to the application through
kono
parents:
diff changeset
1219 ``Clock``. `Best` may mean highest accuracy or largest range."
kono
parents:
diff changeset
1220
kono
parents:
diff changeset
1221 Followed.
kono
parents:
diff changeset
1222
kono
parents:
diff changeset
1223 .. index:: Partition communication subsystem
kono
parents:
diff changeset
1224
kono
parents:
diff changeset
1225 .. index:: PCS
kono
parents:
diff changeset
1226
kono
parents:
diff changeset
1227 RM E.5(28-29): Partition Communication Subsystem
kono
parents:
diff changeset
1228 ================================================
kono
parents:
diff changeset
1229
kono
parents:
diff changeset
1230 "Whenever possible, the PCS on the called partition should allow for
kono
parents:
diff changeset
1231 multiple tasks to call the RPC-receiver with different messages and
kono
parents:
diff changeset
1232 should allow them to block until the corresponding subprogram body
kono
parents:
diff changeset
1233 returns."
kono
parents:
diff changeset
1234
kono
parents:
diff changeset
1235 Followed by GLADE, a separately supplied PCS that can be used with
kono
parents:
diff changeset
1236 GNAT.
kono
parents:
diff changeset
1237
kono
parents:
diff changeset
1238 "The ``Write`` operation on a stream of type ``Params_Stream_Type``
kono
parents:
diff changeset
1239 should raise ``Storage_Error`` if it runs out of space trying to
kono
parents:
diff changeset
1240 write the ``Item`` into the stream."
kono
parents:
diff changeset
1241
kono
parents:
diff changeset
1242 Followed by GLADE, a separately supplied PCS that can be used with
kono
parents:
diff changeset
1243 GNAT.
kono
parents:
diff changeset
1244
kono
parents:
diff changeset
1245 .. index:: COBOL support
kono
parents:
diff changeset
1246
kono
parents:
diff changeset
1247 RM F(7): COBOL Support
kono
parents:
diff changeset
1248 ======================
kono
parents:
diff changeset
1249
kono
parents:
diff changeset
1250 "If COBOL (respectively, C) is widely supported in the target
kono
parents:
diff changeset
1251 environment, implementations supporting the Information Systems Annex
kono
parents:
diff changeset
1252 should provide the child package ``Interfaces.COBOL`` (respectively,
kono
parents:
diff changeset
1253 ``Interfaces.C``) specified in Annex B and should support a
kono
parents:
diff changeset
1254 ``convention_identifier`` of COBOL (respectively, C) in the interfacing
kono
parents:
diff changeset
1255 pragmas (see Annex B), thus allowing Ada programs to interface with
kono
parents:
diff changeset
1256 programs written in that language."
kono
parents:
diff changeset
1257
kono
parents:
diff changeset
1258 Followed.
kono
parents:
diff changeset
1259
kono
parents:
diff changeset
1260 .. index:: Decimal radix support
kono
parents:
diff changeset
1261
kono
parents:
diff changeset
1262 RM F.1(2): Decimal Radix Support
kono
parents:
diff changeset
1263 ================================
kono
parents:
diff changeset
1264
kono
parents:
diff changeset
1265 "Packed decimal should be used as the internal representation for objects
kono
parents:
diff changeset
1266 of subtype ``S`` when ``S``'Machine_Radix = 10."
kono
parents:
diff changeset
1267
kono
parents:
diff changeset
1268 Not followed. GNAT ignores ``S``'Machine_Radix and always uses binary
kono
parents:
diff changeset
1269 representations.
kono
parents:
diff changeset
1270
kono
parents:
diff changeset
1271 .. index:: Numerics
kono
parents:
diff changeset
1272
kono
parents:
diff changeset
1273 RM G: Numerics
kono
parents:
diff changeset
1274 ==============
kono
parents:
diff changeset
1275
kono
parents:
diff changeset
1276 "If Fortran (respectively, C) is widely supported in the target
kono
parents:
diff changeset
1277 environment, implementations supporting the Numerics Annex
kono
parents:
diff changeset
1278 should provide the child package ``Interfaces.Fortran`` (respectively,
kono
parents:
diff changeset
1279 ``Interfaces.C``) specified in Annex B and should support a
kono
parents:
diff changeset
1280 ``convention_identifier`` of Fortran (respectively, C) in the interfacing
kono
parents:
diff changeset
1281 pragmas (see Annex B), thus allowing Ada programs to interface with
kono
parents:
diff changeset
1282 programs written in that language."
kono
parents:
diff changeset
1283
kono
parents:
diff changeset
1284 Followed.
kono
parents:
diff changeset
1285
kono
parents:
diff changeset
1286 .. index:: Complex types
kono
parents:
diff changeset
1287
kono
parents:
diff changeset
1288 RM G.1.1(56-58): Complex Types
kono
parents:
diff changeset
1289 ==============================
kono
parents:
diff changeset
1290
kono
parents:
diff changeset
1291 "Because the usual mathematical meaning of multiplication of a complex
kono
parents:
diff changeset
1292 operand and a real operand is that of the scaling of both components of
kono
parents:
diff changeset
1293 the former by the latter, an implementation should not perform this
kono
parents:
diff changeset
1294 operation by first promoting the real operand to complex type and then
kono
parents:
diff changeset
1295 performing a full complex multiplication. In systems that, in the
kono
parents:
diff changeset
1296 future, support an Ada binding to IEC 559:1989, the latter technique
kono
parents:
diff changeset
1297 will not generate the required result when one of the components of the
kono
parents:
diff changeset
1298 complex operand is infinite. (Explicit multiplication of the infinite
kono
parents:
diff changeset
1299 component by the zero component obtained during promotion yields a NaN
kono
parents:
diff changeset
1300 that propagates into the final result.) Analogous advice applies in the
kono
parents:
diff changeset
1301 case of multiplication of a complex operand and a pure-imaginary
kono
parents:
diff changeset
1302 operand, and in the case of division of a complex operand by a real or
kono
parents:
diff changeset
1303 pure-imaginary operand."
kono
parents:
diff changeset
1304
kono
parents:
diff changeset
1305 Not followed.
kono
parents:
diff changeset
1306
kono
parents:
diff changeset
1307 "Similarly, because the usual mathematical meaning of addition of a
kono
parents:
diff changeset
1308 complex operand and a real operand is that the imaginary operand remains
kono
parents:
diff changeset
1309 unchanged, an implementation should not perform this operation by first
kono
parents:
diff changeset
1310 promoting the real operand to complex type and then performing a full
kono
parents:
diff changeset
1311 complex addition. In implementations in which the ``Signed_Zeros``
kono
parents:
diff changeset
1312 attribute of the component type is ``True`` (and which therefore
kono
parents:
diff changeset
1313 conform to IEC 559:1989 in regard to the handling of the sign of zero in
kono
parents:
diff changeset
1314 predefined arithmetic operations), the latter technique will not
kono
parents:
diff changeset
1315 generate the required result when the imaginary component of the complex
kono
parents:
diff changeset
1316 operand is a negatively signed zero. (Explicit addition of the negative
kono
parents:
diff changeset
1317 zero to the zero obtained during promotion yields a positive zero.)
kono
parents:
diff changeset
1318 Analogous advice applies in the case of addition of a complex operand
kono
parents:
diff changeset
1319 and a pure-imaginary operand, and in the case of subtraction of a
kono
parents:
diff changeset
1320 complex operand and a real or pure-imaginary operand."
kono
parents:
diff changeset
1321
kono
parents:
diff changeset
1322 Not followed.
kono
parents:
diff changeset
1323
kono
parents:
diff changeset
1324 "Implementations in which ``Real'Signed_Zeros`` is ``True`` should
kono
parents:
diff changeset
1325 attempt to provide a rational treatment of the signs of zero results and
kono
parents:
diff changeset
1326 result components. As one example, the result of the ``Argument``
kono
parents:
diff changeset
1327 function should have the sign of the imaginary component of the
kono
parents:
diff changeset
1328 parameter ``X`` when the point represented by that parameter lies on
kono
parents:
diff changeset
1329 the positive real axis; as another, the sign of the imaginary component
kono
parents:
diff changeset
1330 of the ``Compose_From_Polar`` function should be the same as
kono
parents:
diff changeset
1331 (respectively, the opposite of) that of the ``Argument`` parameter when that
kono
parents:
diff changeset
1332 parameter has a value of zero and the ``Modulus`` parameter has a
kono
parents:
diff changeset
1333 nonnegative (respectively, negative) value."
kono
parents:
diff changeset
1334
kono
parents:
diff changeset
1335 Followed.
kono
parents:
diff changeset
1336
kono
parents:
diff changeset
1337 .. index:: Complex elementary functions
kono
parents:
diff changeset
1338
kono
parents:
diff changeset
1339 RM G.1.2(49): Complex Elementary Functions
kono
parents:
diff changeset
1340 ==========================================
kono
parents:
diff changeset
1341
kono
parents:
diff changeset
1342 "Implementations in which ``Complex_Types.Real'Signed_Zeros`` is
kono
parents:
diff changeset
1343 ``True`` should attempt to provide a rational treatment of the signs
kono
parents:
diff changeset
1344 of zero results and result components. For example, many of the complex
kono
parents:
diff changeset
1345 elementary functions have components that are odd functions of one of
kono
parents:
diff changeset
1346 the parameter components; in these cases, the result component should
kono
parents:
diff changeset
1347 have the sign of the parameter component at the origin. Other complex
kono
parents:
diff changeset
1348 elementary functions have zero components whose sign is opposite that of
kono
parents:
diff changeset
1349 a parameter component at the origin, or is always positive or always
kono
parents:
diff changeset
1350 negative."
kono
parents:
diff changeset
1351
kono
parents:
diff changeset
1352 Followed.
kono
parents:
diff changeset
1353
kono
parents:
diff changeset
1354 .. index:: Accuracy requirements
kono
parents:
diff changeset
1355
kono
parents:
diff changeset
1356 RM G.2.4(19): Accuracy Requirements
kono
parents:
diff changeset
1357 ===================================
kono
parents:
diff changeset
1358
kono
parents:
diff changeset
1359 "The versions of the forward trigonometric functions without a
kono
parents:
diff changeset
1360 ``Cycle`` parameter should not be implemented by calling the
kono
parents:
diff changeset
1361 corresponding version with a ``Cycle`` parameter of
kono
parents:
diff changeset
1362 ``2.0*Numerics.Pi``, since this will not provide the required
kono
parents:
diff changeset
1363 accuracy in some portions of the domain. For the same reason, the
kono
parents:
diff changeset
1364 version of ``Log`` without a ``Base`` parameter should not be
kono
parents:
diff changeset
1365 implemented by calling the corresponding version with a ``Base``
kono
parents:
diff changeset
1366 parameter of ``Numerics.e``."
kono
parents:
diff changeset
1367
kono
parents:
diff changeset
1368 Followed.
kono
parents:
diff changeset
1369
kono
parents:
diff changeset
1370 .. index:: Complex arithmetic accuracy
kono
parents:
diff changeset
1371
kono
parents:
diff changeset
1372 .. index:: Accuracy, complex arithmetic
kono
parents:
diff changeset
1373
kono
parents:
diff changeset
1374 RM G.2.6(15): Complex Arithmetic Accuracy
kono
parents:
diff changeset
1375 =========================================
kono
parents:
diff changeset
1376
kono
parents:
diff changeset
1377 "The version of the ``Compose_From_Polar`` function without a
kono
parents:
diff changeset
1378 ``Cycle`` parameter should not be implemented by calling the
kono
parents:
diff changeset
1379 corresponding version with a ``Cycle`` parameter of
kono
parents:
diff changeset
1380 ``2.0*Numerics.Pi``, since this will not provide the required
kono
parents:
diff changeset
1381 accuracy in some portions of the domain."
kono
parents:
diff changeset
1382
kono
parents:
diff changeset
1383 Followed.
kono
parents:
diff changeset
1384
kono
parents:
diff changeset
1385 .. index:: Sequential elaboration policy
kono
parents:
diff changeset
1386
kono
parents:
diff changeset
1387 RM H.6(15/2): Pragma Partition_Elaboration_Policy
kono
parents:
diff changeset
1388 =================================================
kono
parents:
diff changeset
1389
kono
parents:
diff changeset
1390 "If the partition elaboration policy is ``Sequential`` and the
kono
parents:
diff changeset
1391 Environment task becomes permanently blocked during elaboration then the
kono
parents:
diff changeset
1392 partition is deadlocked and it is recommended that the partition be
kono
parents:
diff changeset
1393 immediately terminated."
kono
parents:
diff changeset
1394
kono
parents:
diff changeset
1395 Not followed.