Debian Codegraph @

source_2005/obsolescent.mss

raw
1 @Part(obsolescent, Root="ada.mss")
2
3 @Comment{$Date: 2006/10/19 06:40:32 $}
4 @LabeledNormativeAnnex{Obsolescent Features}
5
6 @Comment{$Source: e:\\cvsroot/ARM/Source/obsolescent.mss,v $}
7 @Comment{$Revision: 1.40 $}
8
9 @begin{Intro}
10 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00368-01]}
11 @Redundant[@Defn{obsolescent feature}
12 This Annex contains descriptions of features of the
13 language whose functionality is largely redundant with other features
14 defined by this International Standard.
15 Use of these features is not recommended in newly written programs.
16 @Chg{Version=[2],New=[Use of these features can be prevented by using pragma
17 Restrictions (No_Obsolescent_Features), see @RefSecNum{Language-Defined Restrictions}.],
18 Old=[]}]
19 @begin{Ramification}
20 These features are still part of the language,
21 and have to be implemented by conforming implementations.
22 The primary reason for putting these descriptions here
23 is to get redundant features out of the way of most readers.
24 The designers of the next version of Ada@Chg{Version=[2],New=[],
25 Old=[ after Ada 95]} will have to
26 assess whether or not it makes sense to drop these features from the
27 language.
28 @end{Ramification}
29 @end{Intro}
30
31 @begin{DiffWord83}
32 @Leading@;The following features have been removed from the language,
33 rather than declared to be obsolescent:
34 @begin{Itemize}
35 The package Low_Level_IO
36 (see @RefSecNum{Input-Output}).
37
38 The Epsilon, Mantissa, Emax, Small, Large, Safe_Emax, Safe_Small, and
39 Safe_Large attributes of floating point types
40 (see @RefSecNum{Attributes of Floating Point Types}).
41
42 @ChgRef{Version=[2],Kind=[Deleted],ARef=[AI95-00284-02]}
43 @ChgDeleted{Version=[2],Text=[The pragma Interface
44 (see @RefSecNum{Interfacing Pragmas}).]}
45
46 The pragmas System_Name, Storage_Unit, and Memory_Size
47 (see @RefSecNum{The Package System}).
48
49 The pragma Shared
50 (see @RefSecNum{Shared Variable Control}).
51 @end{Itemize}
52
53 Implementations can continue to support the above features for upward
54 compatibility.
55 @end{DiffWord83}
56
57 @begin{DiffWord95}
58 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00368-01]}
59 @ChgAdded{Version=[2],Text=[A mention of the No_Obsolescent_Features
60 restriction was added.]}
61 @end{DiffWord95}
62
63
64 @LabeledClause{Renamings of Ada 83 Library Units}
65
66 @begin{StaticSem}
67 The following @nt{library_unit_renaming_declaration}s exist:
68 @begin{Example}
69 @key[with] Ada.Unchecked_Conversion;
70 @key[generic] @key[function] Unchecked_Conversion @key[renames] Ada.Unchecked_Conversion;
71
72 @key[with] Ada.Unchecked_Deallocation;
73 @key[generic] @key[procedure] Unchecked_Deallocation @key[renames] Ada.Unchecked_Deallocation;
74
75 @key[with] Ada.Sequential_IO;
76 @key[generic] @key[package] Sequential_IO @key[renames] Ada.Sequential_IO;
77
78 @key[with] Ada.Direct_IO;
79 @key[generic] @key[package] Direct_IO @key[renames] Ada.Direct_IO;
80
81 @key[with] Ada.Text_IO;
82 @key[package] Text_IO @key[renames] Ada.Text_IO;
83
84 @key[with] Ada.IO_Exceptions;
85 @key[package] IO_Exceptions @key[renames] Ada.IO_Exceptions;
86
87 @key[with] Ada.Calendar;
88 @key[package] Calendar @key[renames] Ada.Calendar;
89
90 @key[with] System.Machine_Code;
91 @key[package] Machine_Code @key[renames] System.Machine_Code; --@RI{ If supported.}
92 @end{Example}
93 @end{StaticSem}
94
95 @begin{ImplReq}
96 The implementation shall allow the user to replace these renamings.
97 @end{ImplReq}
98
99
100 @LabeledClause{Allowed Replacements of Characters}
101
102 @begin{Syntax}
103 @begin{SyntaxText}
104 @Leading@;The following replacements are allowed for the vertical line, number sign,
105 and quotation mark characters:
106 @begin{Itemize}
107 A vertical line character (|) can be replaced by an exclamation mark
108 (!) where used as a delimiter.
109
110
111 The number sign characters (#) of a @nt{based_literal} can be replaced
112 by colons (:) provided that the replacement is done for both
113 occurrences.
114 @begin{Honest}
115 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00285-01]}
116 The intent is that such a replacement works in the
117 Value@Chg{Version=[2],New=[,],Old=[ and]}
118 Wide_Value@Chg{Version=[2],New=[, and Wide_Wide_Value],Old=[]} attributes,
119 and in the Get procedures of Text_IO@Chg{Version=[2],New=[ (and Wide_Text_IO
120 and Wide_Wide_Text_IO as well)],Old=[]}},
121 so that things like @lquotes@;16:.123:@rquotes@; is acceptable.
122 @end{Honest}
123
124 The quotation marks (") used as string brackets at both ends of
125 a string literal can be replaced by percent signs (%) provided
126 that the enclosed sequence of characters contains no quotation mark, and
127 provided that both string brackets are replaced. Any
128 percent sign within the sequence of characters shall then be
129 doubled and each such doubled percent sign is interpreted as a
130 single percent sign character value.
131 @end{Itemize}
132
133 These replacements do not change the meaning of the program.
134 @begin{Reason}
135 The original purpose of this feature was to support hardware (for
136 example, teletype machines) that has long been obsolete.
137 The feature is no longer necessary for that reason.
138 Another use of the feature has been to replace the vertical line
139 character (|) when using certain hardware that treats that character
140 as a (non-English) letter.
141 The feature is no longer necessary for that reason, either,
142 since Ada 95 has full support for international character sets.
143 Therefore, we believe this feature is no longer necessary.
144
145 Users of equipment that still uses | to represent a letter will
146 continue to do so.
147 Perhaps by next the time Ada is revised,
148 such equipment will no longer be in use.
149
150 @Leading@;Note that it was never legal to use this feature as a convenient
151 method of including double quotes in a string without doubling them
152 @em the string literal:
153 @begin{Example}
154 %"This is quoted."%
155 @end{Example}
156
157 @Leading@;is not legal in Ada 83, nor will it be in Ada 95. One has to write:
158 @begin{Example}
159 """This is quoted."""
160 @end{Example}
161 @end{Reason}
162 @end{SyntaxText}
163 @end{Syntax}
164
165 @LabeledClause{Reduced Accuracy Subtypes}
166
167 @begin{Intro}
168 A @nt<digits_constraint> may be used to define
169 a floating point subtype with a new
170 value for its requested decimal precision, as reflected
171 by its Digits attribute. Similarly, a @nt<delta_constraint>
172 may be used to define an ordinary fixed point subtype with
173 a new value for its @i(delta), as reflected by its Delta
174 attribute.
175 @begin(Discussion)
176 It might be more direct to make these attributes
177 specifiable via an @nt<attribute_definition_clause>, and eliminate the
178 syntax for these @ntf<_constraint>s.
179 @end(Discussion)
180 @end{Intro}
181
182 @begin{Syntax}
183 @Syn{lhs=<delta_constraint>,
184 rhs="@key{delta} @SynI{static_}@Syn2{expression} [@Syn2{range_constraint}]"}
185 @end{Syntax}
186
187 @begin{Resolution}
188 @PDefn2{Term=[expected type], Sec=(delta_constraint expression)}
189 The @nt<expression> of a @nt<delta_constraint> is expected to be of
190 any real type.
191 @end{Resolution}
192
193 @begin{Legality}
194 The @nt<expression> of a @nt<delta_constraint> shall be static.
195
196 For a @nt<subtype_indication> with a @nt<delta_constraint>, the
197 @nt<subtype_mark> shall denote an ordinary fixed point subtype.
198
199 @Defn{notwithstanding}
200 For a @nt<subtype_indication> with a @nt<digits_constraint>,
201 the @nt<subtype_mark> shall denote either a decimal fixed point subtype
202 or a floating point subtype
203 (notwithstanding the rule given in @RefSecNum(Fixed Point Types)
204 that only allows a decimal fixed point subtype).
205 @begin(Discussion)
206 @ChgRef{Version=[2],Kind=[Deleted],ARef=[AI95-00114-01]}
207 @ChgDeleted{Version=[2],Text=[We may need a better way to deal with
208 obsolescent features with rules that contradict those of the non-obsolescent
209 parts of the standard.]}
210 @end(Discussion)
211 @end{Legality}
212
213 @begin{StaticSem}
214 A @nt<subtype_indication> with a @nt<subtype_mark> that
215 denotes an ordinary fixed point subtype and a @nt<delta_constraint>
216 defines an ordinary fixed point subtype with a @i(delta)
217 given by the value of the @nt<expression> of the
218 @nt<delta_constraint>.
219 If the @nt<delta_constraint> includes a @nt<range_@!constraint>, then
220 the ordinary fixed point subtype is constrained by the @nt<range_@!constraint>.
221
222 A @nt<subtype_indication> with a @nt<subtype_mark> that
223 denotes a floating point subtype and a @nt<digits_constraint>
224 defines a floating point subtype with a requested decimal precision
225 (as reflected by its Digits attribute)
226 given by the value of the @nt<expression> of the @nt<digits_constraint>.
227 If the @nt<digits_constraint> includes a @nt<range_@!constraint>, then
228 the floating point subtype is constrained by the @nt<range_@!constraint>.
229 @end{StaticSem}
230
231 @begin{RunTime}
232 @PDefn2{Term=[compatibility],
233 Sec=(delta_constraint with an ordinary fixed point subtype)}
234 A @nt<delta_constraint> is @i(compatible) with an ordinary
235 fixed point subtype if the value of the @nt<expression> is no less
236 than the @i(delta) of the subtype, and the @nt<range_constraint>, if any,
237 is compatible with the subtype.
238
239 @PDefn2{Term=[compatibility],
240 Sec=(digits_constraint with a floating point subtype)}
241 A @nt<digits_constraint> is @i(compatible) with a
242 floating point subtype if the value of the @nt<expression> is no greater
243 than the requested decimal precision of the subtype, and
244 the @nt<range_constraint>, if any,
245 is compatible with the subtype.
246
247 @PDefn2{Term=[elaboration], Sec=(delta_constraint)}
248 The elaboration of a @nt<delta_constraint> consists of the
249 elaboration of the @nt<range_constraint>, if any.
250 @begin{Reason}
251 A numeric subtype is considered @lquotes@;constrained@rquotes@; only if a range constraint
252 applies to it. The only effect of a @nt<digits_constraint> or a
253 @nt<delta_constraint> without a @nt<range_constraint> is to specify
254 the value of the corresponding Digits or Delta attribute in
255 the new subtype. The set of values of the subtype is not @lquotes@;constrained@rquotes@;
256 in any way by such @ntf<_constraint>s.
257 @end{Reason}
258 @end{RunTime}
259
260 @begin{DiffWord83}
261 In Ada 83, a @nt<delta_constraint> is called a fixed_point_constraint,
262 and a @nt<digits_constraint> is called a floating_point_constraint.
263 We have adopted other terms because @nt<digits_constraint>s apply
264 primarily to decimal fixed point types now (they apply to
265 floating point types only as an obsolescent feature).
266 @end{DiffWord83}
267
268 @RMNewPage@Comment{For printed Ada 2007 RM}
269 @LabeledClause{The Constrained Attribute}
270
271 @begin{StaticSem}
272 @Leading@;For every private subtype S, the following attribute is defined:
273 @begin{Discussion}
274 This includes generic formal private subtypes.
275 @end{Discussion}
276 @begin{Description}
277 S'@attr{Constrained}@\Yields the value False if S denotes an unconstrained
278 nonformal private subtype with discriminants; also yields the
279 value False if S denotes a generic formal private subtype, and
280 the associated actual subtype is either an unconstrained subtype
281 with discriminants or an unconstrained array subtype; yields
282 the value True otherwise. The value of this attribute is of
283 the predefined subtype Boolean.
284 @begin{Reason}
285 Because Ada 95 has @nt{unknown_discriminant_part}s,
286 the Constrained attribute of private subtypes is obsolete.
287 This is fortunate, since its Ada 83 definition was confusing,
288 as explained below. Because this attribute is obsolete,
289 we do not bother to extend its definition to private extensions.
290
291 The Constrained attribute of an object is @i(not) obsolete.
292
293 Note well: S'Constrained matches the Ada 95 definition of @lquotes@;constrained@rquotes@;
294 only for composite subtypes. For elementary subtypes,
295 S'Constrained is always true, whether or not S is constrained.
296 (The Constrained attribute of an object does not have this problem,
297 as it is only defined for objects of a discriminated type.)
298 So one should think of its designator as being 'Constrained_Or_Elementary.
299 @end{Reason}
300 @end{Description}
301 @end{StaticSem}
302
303 @LabeledClause{ASCII}
304
305 @begin{StaticSem}
306 @Leading@;The following declaration exists in the declaration of package
307 Standard:
308 @begin{example}
309 @key[package] ASCII @key[is]
310
311
312 --@RI{ Control characters:}
313
314
315 @tabclear()@tabset(P47)
316 NUL : @key[constant] Character := @RI{nul}; @\SOH : @key[constant] Character := @RI{soh};
317 STX : @key[constant] Character := @RI{stx}; @\ETX : @key[constant] Character := @RI{etx};
318 EOT : @key[constant] Character := @RI{eot}; @\ENQ : @key[constant] Character := @RI{enq};
319 ACK : @key[constant] Character := @RI{ack}; @\BEL : @key[constant] Character := @RI{bel};
320 BS : @key[constant] Character := @RI{bs}; @\HT : @key[constant] Character := @RI{ht};
321 LF : @key[constant] Character := @RI{lf}; @\VT : @key[constant] Character := @RI{vt};
322 FF : @key[constant] Character := @RI{ff}; @\CR : @key[constant] Character := @RI{cr};
323 SO : @key[constant] Character := @RI{so}; @\SI : @key[constant] Character := @RI{si};
324 DLE : @key[constant] Character := @RI{dle}; @\DC1 : @key[constant] Character := @RI{dc1};
325 DC2 : @key[constant] Character := @RI{dc2}; @\DC3 : @key[constant] Character := @RI{dc3};
326 DC4 : @key[constant] Character := @RI{dc4}; @\NAK : @key[constant] Character := @RI{nak};
327 SYN : @key[constant] Character := @RI{syn}; @\ETB : @key[constant] Character := @RI{etb};
328 CAN : @key[constant] Character := @RI{can}; @\EM : @key[constant] Character := @RI{em};
329 SUB : @key[constant] Character := @RI{sub}; @\ESC : @key[constant] Character := @RI{esc};
330 FS : @key[constant] Character := @RI{fs}; @\GS : @key[constant] Character := @RI{gs};
331 RS : @key[constant] Character := @RI{rs}; @\US : @key[constant] Character := @RI{us};
332 DEL : @key[constant] Character := @RI{del};
333
334
335 --@RI{ Other characters:}
336
337 Exclam : @key[constant] Character:= '!';@\Quotation : @key[constant] Character:= '"';
338 Sharp : @key[constant] Character:= '#';@\Dollar : @key[constant] Character:= '$';
339 Percent : @key[constant] Character:= '%';@\Ampersand : @key[constant] Character:= '&';
340 Colon : @key[constant] Character:= ':';@\Semicolon : @key[constant] Character:= ';';
341 Query : @key[constant] Character:= '?';@\At_Sign : @key[constant] Character:= '@@';
342 L_Bracket: @key[constant] Character:= '[';@\Back_Slash: @key[constant] Character:= '\';
343 R_Bracket: @key[constant] Character:= ']';@\Circumflex: @key[constant] Character:= '^';
344 Underline: @key[constant] Character:= '_';@\Grave : @key[constant] Character:= '`';
345 L_Brace : @key[constant] Character:= '{';@\Bar : @key[constant] Character:= '|';
346 R_Brace : @key[constant] Character:= '}';@\Tilde : @key[constant] Character:= '~';
347
348 --@RI{ Lower case letters:}
349
350
351 LC_A: @key[constant] Character:= 'a';
352 ...
353 LC_Z: @key[constant] Character:= 'z';
354
355
356 @key[end] ASCII;
357 @end{example}
358 @end{StaticSem}
359
360
361 @LabeledClause{Numeric_Error}
362
363 @begin{StaticSem}
364 @Leading@;The following declaration exists in the declaration
365 of package Standard:
366 @begin{Example}
367 Numeric_Error : @key[exception] @key[renames] Constraint_Error;
368 @end{Example}
369 @begin{Discussion}
370 This is true even though it is not shown in
371 @RefSecNum{The Package Standard}.
372 @end{Discussion}
373 @begin{Reason}
374 In Ada 83, it was unclear which situations should raise
375 Numeric_Error, and which should raise Constraint_Error.
376 The permissions of RM83-11.6 could often be used to allow
377 the implementation to raise Constraint_Error in a situation
378 where one would normally expect Numeric_Error.
379 To avoid this confusion, all situations that raise Numeric_Error in
380 Ada 83 are changed to raise Constraint_Error in Ada 95.
381 Numeric_Error is changed to be a renaming of Constraint_Error
382 to avoid most of the upward compatibilities associated with
383 this change.
384
385 In new code, Constraint_Error should be used instead of Numeric_Error.
386 @end{Reason}
387 @end{StaticSem}
388
389 @LabeledClause{At Clauses}
390
391 @begin{Syntax}
392 @Syn{lhs=<at_clause>,rhs="@key{for} @Syn2{direct_name} @key{use} @key{at} @Syn2{expression};"}
393 @end{Syntax}
394
395 @begin{StaticSem}
396 An @nt{at_clause} of the form @lquotes@;for @i{x} use at @i{y};@rquotes@; is
397 equivalent to an @nt{attribute_definition_clause} of the form
398 @lquotes@;for @i{x}'Address use @i{y};@rquotes@;.
399 @begin{Reason}
400 The preferred syntax for specifying the address of an entity is an
401 @nt{attribute_definition_clause} specifying the Address attribute.
402 Therefore, the special-purpose @nt{at_clause} syntax is now obsolete.
403
404 The above equivalence implies, for example, that only one @nt{at_clause}
405 is allowed for a given entity.
406 Similarly, it is illegal to give both
407 an @nt{at_clause}
408 and an @nt{attribute_definition_clause} specifying the Address attribute.
409 @end{Reason}
410 @end{StaticSem}
411
412 @begin{Extend83}
413 @Defn{extensions to Ada 83}
414 We now allow to define the address of an entity using an
415 @nt{attribute_definition_clause}.
416 This is because Ada 83's @nt{at_clause} is so hard to
417 remember: programmers often tend to write @lquotes@;for X'Address use...;@rquotes@;.
418 @end{Extend83}
419
420 @begin{DiffWord83}
421 Ada 83's @ntf{address_clause} is now called an @nt{at_clause} to avoid
422 confusion with the new term @lquotes@;Address clause@rquotes@; (that is, an
423 @nt{attribute_definition_clause} for the Address attribute).
424 @end{DiffWord83}
425
426 @LabeledSubClause{Interrupt Entries}
427
428 @begin{Intro}
429 @redundant[Implementations are permitted to allow the attachment of task entries to
430 interrupts via the address clause. Such an entry is referred to as an
431 @i{interrupt entry}.
432
433 The address of the task entry corresponds to a hardware interrupt in an
434 implementation-defined manner. (See Ada.Interrupts.Reference in
435 @RefSecNum{The Package Interrupts}.)]
436 @end{Intro}
437
438 @begin{StaticSem}
439 @Leading@;The following attribute is defined:
440
441 @Leading@;For any task entry X:
442 @begin{Description}
443 @Defn{interrupt entry}
444 X'@attr{Address} @\For a task entry whose address is specified
445 (an @i{interrupt entry}), the value
446 refers to the corresponding hardware interrupt. For such
447 an entry, as for any other task entry, the meaning of this
448 value is implementation defined. The value of this attribute
449 is of the type of the subtype System.Address.
450
451 @NoPrefix@;@PDefn2{Term=[specifiable], Sec=(of Address for entries)}
452 Address may be specified for single entries
453 via an @nt{attribute_definition_clause}.
454 @begin{Reason}
455 Because of the equivalence of @nt{at_clause}s and
456 @nt{attribute_definition_clause}s, an interrupt entry may be
457 specified via either notation.
458 @end{Reason}
459 @end{Description}
460 @end{StaticSem}
461
462 @begin{RunTime}
463
464 @PDefn2{Term=[initialization], Sec=[of a task object]}
465 As part of the initialization of a task object, the
466 address clause for an interrupt entry is
467 elaborated@Redundant[, which evaluates the
468 @nt<expression> of the address clause].
469 A check is made that the address specified is
470 associated with some interrupt to which a task entry may be attached.
471 @Defn2{Term=[Program_Error],Sec=(raised by failure of run-time check)}
472 If this check fails, Program_Error is raised.
473 Otherwise, the interrupt entry
474 is attached to the interrupt associated with the specified address.
475
476 @PDefn2{Term=[finalization], Sec=[of a task object]}
477 Upon finalization of the task object, the interrupt entry, if any, is
478 detached from the corresponding interrupt and the default treatment is
479 restored.
480
481 While an interrupt entry is attached to an interrupt,
482 the interrupt is reserved (see @RefSecNum{Interrupt Support}).
483
484 An interrupt delivered to a task entry acts as a call to the entry issued by
485 a hardware task whose priority is in the System.Interrupt_Priority range.
486 It is implementation defined whether the call is performed as
487 an ordinary entry call, a timed entry
488 call, or a conditional entry call; which kind of call is performed
489 can depend on the specific interrupt.
490
491 @end{RunTime}
492
493 @begin{Bounded}
494 @PDefn2{Term=(bounded error),Sec=(cause)}
495 It is a bounded error to evaluate
496 E'Caller (see @RefSecNum(The Package Task_Identification))
497 in an @nt{accept_statement} for an interrupt
498 entry. The possible effects are
499 the same as for calling Current_Task from an entry body.
500 @end{Bounded}
501
502 @begin{DocReq}
503
504 The implementation shall document to which interrupts a
505 task entry may be attached.
506 @ChgDocReq{Version=[2],Kind=[AddedNormal],Text=[@ChgAdded{Version=[2],
507 Text=[The interrupts to which a task entry may be attached.]}]}
508
509 The implementation shall document whether the invocation of an interrupt entry
510 has the effect of an ordinary entry call, conditional call, or a timed call,
511 and whether the effect varies in the presence of pending interrupts.
512 @ChgDocReq{Version=[2],Kind=[AddedNormal],Text=[@ChgAdded{Version=[2],
513 Text=[The type of entry call invoked for an interrupt entry.]}]}
514
515 @end{DocReq}
516
517 @begin{ImplPerm}
518 The support for this subclause is optional.
519
520 Interrupts to which the implementation allows a task entry to be
521 attached may be designated as reserved for the entire duration
522 of program execution@Redundant[; that is, not just when they have an
523 interrupt entry attached to them].
524
525 @ChgRef{Version=[1],Kind=[Revised],Ref=[8652/0077],ARef=[AI95-00111-01]}
526 Interrupt entry calls may be implemented by having the hardware execute
527 directly the appropriate @Chg{New=[@nt{accept_statement}],Old=[accept body]}.
528 Alternatively, the implementation is allowed to provide an internal interrupt
529 handler to simulate the effect of a normal task calling the entry.
530
531 The implementation is allowed to impose restrictions on the specifications
532 and bodies of tasks that have interrupt entries.
533
534 It is implementation defined whether direct calls (from the program) to
535 interrupt entries are allowed.
536
537 If a @nt{select_statement} contains both a @nt{terminate_alternative} and an
538 @nt{accept_alternative} for an interrupt entry, then an implementation is
539 allowed to impose further requirements for the selection of the
540 @nt{terminate_alternative} in addition to those given in
541 @RefSecNum{Task Dependence - Termination of Tasks}.
542 @end{ImplPerm}
543
544 @begin{Notes}
545 @ChgRef{Version=[1],Kind=[Revised],Ref=[8652/0077],ARef=[AI95-00111-01]}
546 Queued interrupts correspond to ordinary entry calls. Interrupts that are
547 lost if not immediately processed correspond to conditional entry calls. It
548 is a consequence of the priority rules that an @Chg{New=[@nt{accept_statement}],
549 Old=[accept body]} executed in response to an interrupt can be executed with
550 the active priority at which the hardware generates the interrupt, taking
551 precedence over lower priority tasks, without a scheduling action.
552
553 Control information that is supplied upon an interrupt can be passed to an
554 associated interrupt entry as one or more parameters of mode @key[in].
555 @end{Notes}
556
557 @begin{Examples}
558 @leading@keepnext@i{Example of an interrupt entry:}
559 @begin{example}
560 @key[task] Interrupt_Handler @key[is]
561 @key[entry] Done;
562 @key[for] Done'Address @key[use] Ada.Interrupts.Reference(Ada.Interrupts.Names.Device_Done);
563 @key[end] Interrupt_Handler;
564
565 @end{example}
566 @end{Examples}
567
568 @begin{DiffWord83}
569
570 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00114-01]}
571 RM83-13.5.1 did not adequately address the problems
572 @Chg{Version=[2],New=[associated],Old=[associate]} with
573 interrupts. This feature is now obsolescent and is replaced by the Ada 95
574 interrupt model as specified in the Systems Programming Annex.
575 @end{DiffWord83}
576
577 @begin{DiffWord95}
578 @ChgRef{Version=[2],Kind=[AddedNormal],Ref=[8652/0077],ARef=[AI95-00111-01]}
579 @Chg{Version=[2],New=[@b<Corrigendum:> The undefined term @i{accept body}
580 was replaced by @nt{accept_statement}.], Old=[]}
581 @end{DiffWord95}
582
583 @RMNewPage@Comment{For printed RM Ada 2007}
584 @LabeledClause{Mod Clauses}
585
586 @begin{Syntax}
587 @Syn{lhs=<mod_clause>,rhs="@key{at} @key{mod} @SynI{static_}@Syn2{expression};"}
588 @end{Syntax}
589
590 @begin{StaticSem}
591 @leading@keepnext@;A @nt{record_representation_clause} of the form:
592 @begin{example}
593 @key[for] @RI{r} @key[use]
594 @key[record] @key[at] @key[mod] @RI{a}
595 ...
596 @key[end] @key[record];
597 @end{example}
598
599 @leading@keepnext@;is equivalent to:
600 @begin{example}
601 @key[for] @RI{r}'Alignment @key[use] @RI{a};
602 @key[for] @RI{r} @key[use]
603 @key[record]
604 ...
605 @key[end] @key[record];
606 @end{example}
607 @begin{Reason}
608 The preferred syntax for specifying the alignment of an entity is an
609 @nt{attribute_definition_clause} specifying the Alignment attribute.
610 Therefore, the special-purpose @nt{mod_clause} syntax is now
611 obsolete.
612
613 The above equivalence implies, for example, that it is illegal to give both
614 a @nt{mod_clause}
615 and an @nt{attribute_definition_clause} specifying the Alignment attribute
616 for the same type.
617 @end{Reason}
618 @end{StaticSem}
619
620 @begin{DiffWord83}
621 Ada 83's @ntf{alignment_clause} is now called a @nt{mod_clause} to avoid
622 confusion with the new term @lquotes@;Alignment clause@rquotes@; (that is, an
623 @nt{attribute_definition_clause} for the Alignment attribute).
624 @end{DiffWord83}
625
626 @LabeledClause{The Storage_Size Attribute}
627
628 @begin{StaticSem}
629 @Leading@;For any task subtype T, the following attribute is defined:
630 @begin{Description}
631 T'@attr{Storage_Size} @\Denotes an implementation-defined value
632 of type @i{universal_integer}
633 representing the number of storage
634 elements reserved for a task of the subtype T.
635 @begin{Honest}
636 T'Storage_Size cannot be particularly meaningful in the presence of a
637 @nt{pragma} Storage_Size, especially when the expression is dynamic, or
638 depends on a discriminant of the task,
639 because the Storage_Size will be different for different objects of the type.
640 Even without such a @nt{pragma},
641 the Storage_Size can be different for different objects of the type,
642 and in any case, the value is implementation defined.
643 Hence, it is always implementation defined.
644 @end{Honest}
645
646 @NoPrefix@ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00345-01]}
647 @PDefn2{Term=[specifiable], Sec=(of Storage_Size for a task
648 first subtype)}
649 @NoPrefix@;Storage_Size may be specified for a task first subtype
650 @Chg{Version=[2],New=[that is not an interface ],Old=[]}via
651 an @nt{attribute_definition_clause}.
652 @end{Description}
653 @end{StaticSem}
654
655 @begin{DiffWord95}
656 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00345-01]}
657 @ChgAdded{Version=[2],Text=[We don't allow specifying Storage_Size on
658 task interfaces. We don't need to mention class-wide task types, because
659 these cannot be a first subtype.]}
660 @end{DiffWord95}
661
662 @LabeledAddedClause{Version=[2],Name=[Specific Suppression of Checks]}
663
664 @begin{Intro}
665 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00224-01]}
666 @ChgAdded{Version=[2],Text=[Pragma Suppress can be used to suppress checks on
667 specific entities.]}
668 @end{Intro}
669
670 @begin{Syntax}
671 @begin{SyntaxText}
672 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00224-01]}
673 @ChgAdded{Version=[2],KeepNext=[T],Type=[Leading],Text=[The form of a specific
674 Suppress @nt{pragma} is as follows:]}
675 @end{SyntaxText}
676
677 @ChgRef{Version=[2],Kind=[AddedNormal]}
678 @Chg{Version=[2],
679 New=`@ @ @key{pragma} @prag{Suppress}(@Syn2{identifier}, [On =>] @Syn2{name});',
680 Old=<>}
681 @end{Syntax}
682
683 @begin{Legality}
684 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00224-01]}
685 @ChgAdded{Version=[2],Text=[The @nt{identifier} shall be the name of a check
686 (see @RefSecNum{Suppressing Checks}). The @nt{name} shall
687 statically denote some entity.]}
688
689 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00224-01]}
690 @ChgAdded{Version=[2],Text=[For a specific Suppress @nt{pragma} that is
691 immediately within a @nt{package_specification}, the @nt{name} shall denote an
692 entity (or several overloaded subprograms) declared immediately within the
693 @nt{package_@!specification}.]}
694 @end{Legality}
695
696 @begin{StaticSem}
697 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00224-01]}
698 @ChgAdded{Version=[2],Text=[A specific Suppress @nt{pragma} applies to the
699 named check from the place of the @nt{pragma} to the end of the innermost
700 enclosing declarative region, or, if the @nt{pragma} is given in a
701 @nt{package_specification}, to the end of the scope of the named entity. The
702 @nt{pragma} applies only to the named entity, or, for a subtype, on objects and
703 values of its type. A specific Suppress @nt{pragma} suppresses the named check
704 for any entities to which it applies (see @RefSecNum{Suppressing Checks}).
705 Which checks are associated with a specific entity is not defined by this
706 International Standard.]}
707
708 @ChgRef{Version=[2],Kind=[AddedNormal]}
709 @begin{Discussion}
710 @ChgAdded{Version=[2],Text=[The language doesn't specify exactly which entities
711 control whether a check is performed. For example, in]}
712 @begin{Example}
713 @Chg{Version=[2],New=[@key{pragma} Suppress (Range_Check, On => A);
714 A := B;],Old=[]}
715 @end{Example}
716 @ChgAdded{Version=[2],Text=[whether or not the range check is performed is not
717 specified. The compiler may require that checks are suppressed on B or on the
718 type of A in order to omit the range check.]}
719 @end{Discussion}
720 @end{StaticSem}
721
722 @begin{ImplPerm}
723 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00224-01]}
724 @ChgAdded{Version=[2],Text=[An implementation is allowed to place restrictions on
725 specific Suppress @nt{pragma}s.]}
726 @end{ImplPerm}
727
728 @begin{Notes}
729 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00224-01]}
730 @ChgAdded{Version=[2],Text=[An implementation may support a similar On parameter on
731 @nt{pragma} Unsuppress (see @RefSecNum{Suppressing Checks}).]}
732 @end{Notes}
733
734 @begin{DiffWord95}
735 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00224-01]}
736 @ChgAdded{Version=[2],Text=[This clause is new. This feature was moved here
737 because it is important for pragma Unsuppress that there be an unambiguous
738 meaning for each checking pragma. For instance, in the example]}
739 @begin{Example}
740 @ChgAdded{Version=[2],Text=[@key{pragma} Suppress (Range_Check);
741 @key{pragma} Unsuppress (Range_Check, On => A);
742 A := B;]}
743 @end{Example}
744 @ChgAdded{Version=[2],Text=[the user needs to be able to depend on the range check
745 being made on the assignment. But a compiler survey showed that the
746 interpretation of this feature varied widely; trying to define this carefully
747 was likely to cause a lot of user and implementer pain. Thus the feature was
748 moved here, to emphasize that its use is not portable.]}
749 @end{DiffWord95}
750
751
752 @LabeledAddedClause{Version=[2],Name=[The Class Attribute of Untagged Incomplete Types]}
753
754
755 @begin{StaticSem}
756 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00326-01]}
757 @ChgAdded{Version=[2],Type=[Leading],Text=[For the first subtype S of a type
758 @i<T> declared by an @nt<incomplete_type_declaration> that is not tagged, the
759 following attribute is defined:]}
760 @begin{Description}
761 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00326-01]}
762 @Chg{Version=[2],New=[S'@attr{Class} @\Denotes the first subtype of the
763 incomplete class-wide type rooted at @i<T>. The completion of @i<T> shall
764 declare a tagged type. Such an attribute reference shall occur in the same
765 library unit as the @nt<incomplete_type_declaration>.],Old=[]}
766 @end{Description}
767 @begin{Reason}
768 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00326-01]}
769 @ChgAdded{Version=[2],Text=[This must occur in the same unit to prevent
770 children from imposing requirements on their ancestor library
771 units for deferred incomplete types.]}
772 @end{reason}
773 @end{StaticSem}
774
775 @begin{DiffWord95}
776 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00326-01]}
777 @Chg{Version=[2],New=[This clause is new. This feature was moved here
778 because the tagged incomplete type provides a better way to provide this
779 capability (it doesn't put requirements on the completion based on uses that
780 could be anywhere). Pity we didn't think of it in 1994.],Old=[]}
781 @end{DiffWord95}
782
783
784 @LabeledAddedClause{Version=[2],Name=[Pragma Interface]}
785
786 @begin{Syntax}
787 @begin{SyntaxText}
788 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00284-02]}
789 @ChgAdded{Version=[2],Text=[In addition to an identifier, the reserved word
790 @key{interface} is allowed as a pragma name, to provide compatibility with a prior
791 edition of this International Standard.]}
792 @end{SyntaxText}
793 @end{Syntax}
794
795 @begin{ImplNote}
796 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00284-02]}
797 @ChgAdded{Version=[2],Text=[All implementations need to at least recognize and
798 ignore this pragma. A syntax error is not an acceptable implementation of
799 this pragma.]}
800 @end{ImplNote}
801
802 @begin{DiffWord95}
803 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00326-01]}
804 @ChgAdded{Version=[2],Text=[This clause is new. This is necessary as @key{interface}
805 is now a reserved word, which would prevent pragma Interface from being an
806 implementation-defined pragma. We don't define any semantics for this
807 pragma, as we expect that implementations will continue to use whatever they
808 currently implement - requiring any changes would be counter-productive.]}
809 @end{DiffWord95}
810
811
812 @LabeledAddedClause{Version=[2],Name=[Dependence Restriction Identifiers]}
813
814 @begin{Intro}
815 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00394-01]}
816 @ChgAdded{Version=[2],Text=[The following restrictions involve dependence
817 on specific language-defined units. The more general restriction No_Dependence
818 (see @RefSecNum{Language-Defined Restrictions}) should be used for this purpose.]}
819 @end{Intro}
820
821
822 @begin{StaticSem}
823
824 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00394-01]}
825 @ChgAdded{Version=[2],Type=[Leading],
826 Text=[The following @Syni<restriction_>@nt<identifier>s exist:]}
827
828 @begin{Description}
829
830 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00394-01]}
831 @ChgAdded{Version=[2],Text=[@Defn2{Term=[Restrictions],
832 Sec=(No_Asynchronous_Control)}No_Asynchronous_Control @\Semantic dependence
833 on the predefined package Asynchronous_Task_Control is not allowed.]}
834
835 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00394-01]}
836 @ChgAdded{Version=[2],Text=[@Defn2{Term=[Restrictions],
837 Sec=(No_Unchecked_Conversion)}No_Unchecked_Conversion @\Semantic
838 dependence on the predefined generic function Unchecked_Conversion is not
839 allowed.]}
840
841 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00394-01]}
842 @ChgAdded{Version=[2],Text=[@Defn2{Term=[Restrictions],
843 Sec=(No_Unchecked_Deallocation)}No_Unchecked_Deallocation @\Semantic
844 dependence on the predefined generic procedure Unchecked_Deallocation is
845 not allowed.]}
846
847 @end{Description}
848 @end{StaticSem}
849
850 @begin{DiffWord95}
851 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00394-01]}
852 @ChgAdded{Version=[2],Text=[This clause is new. These restrictions
853 are replaced by the more general No_Dependence
854 (see @RefSecNum{Language-Defined Restrictions}).]}
855 @end{DiffWord95}
856
857 @RMNewPage
858 @LabeledAddedClause{Version=[2],Name=[Character and Wide_Character Conversion Functions]}
859
860 @begin{StaticSem}
861
862 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00395-01]}
863 @ChgAdded{Version=[2],Type=[Leading],
864 Text=[The following declarations exist in the declaration of package
865 Ada.Characters.Handling:]}
866
867 @begin{Example}
868 @ChgRef{Version=[2],Kind=[AddedNormal]}
869 @ChgAdded{Version=[2],Text=[ @key{function} Is_Character (Item : @key{in} Wide_Character) @key{return} Boolean
870 @key{renames} Conversions.Is_Character;
871 @key{function} Is_String (Item : @key{in} Wide_String) @key{return} Boolean
872 @key{renames} Conversions.Is_String;]}
873
874 @ChgRef{Version=[2],Kind=[AddedNormal]}
875 @ChgAdded{Version=[2],Text=[ @key{function} To_Character (Item : @key{in} Wide_Character;
876 Substitute : @key{in} Character := ' ')
877 @key{return} Character
878 @key{renames} Conversions.To_Character;]}
879
880 @ChgRef{Version=[2],Kind=[AddedNormal]}
881 @ChgAdded{Version=[2],Text=[ @key{function} To_String (Item : @key{in} Wide_String;
882 Substitute : @key{in} Character := ' ')
883 @key{return} String
884 @key{renames} Conversions.To_String;]}
885
886 @ChgRef{Version=[2],Kind=[AddedNormal]}
887 @ChgAdded{Version=[2],Text=[ @key{function} To_Wide_Character (Item : @key{in} Character) @key{return} Wide_Character
888 @key{renames} Conversions.To_Wide_Character;]}
889
890 @ChgRef{Version=[2],Kind=[AddedNormal]}
891 @ChgAdded{Version=[2],Text=[ @key{function} To_Wide_String (Item : @key{in} String) @key{return} Wide_String
892 @key{renames} Conversions.To_Wide_String;]}
893 @end{Example}
894 @end{StaticSem}
895
896 @begin{DiffWord95}
897 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00394-01]}
898 @ChgAdded{Version=[2],Text=[This clause is new. These subprograms were
899 moved to Characters.Conversions
900 (see @RefSecNum{The Package Characters.Conversions}).]}
901 @end{DiffWord95}
902