Debian Codegraph @

source_2005/01.mss

raw
1 @Part(01, Root="ada.mss")
2
3 @PrefaceSection{} @Comment{Go to odd page.}
4
5 @begin{Comment}
6 The following stuff is to get the "INTERNATIONAL STANDARD" title between
7 two horizontal rules at the top of page 1. (RLB-The following is a hack:
8 I probably ought to add a style just for this purpose)
9 @end{Comment}
10
11 @thickline
12
13 @begin{Wide}
14 @noparanum@leading@tabclear()@tabset(P45)
15 @Swiss<@Grow[@B{INTERNATIONAL STANDARD@\ISO/IEC 8652:@Chg{Version=[2],New=[2007(E), Ed. 3],Old=[@Chg{Version=[1], New=[1995(E) with COR.1:2001], Old=[]}]}}]>
16 @end{Wide}
17
18 @thickline
19
20 @noparanum@ @*@comment{Some vertical whitespace}
21 @ @*
22 @ @*
23
24 @noparanum@Swiss{@Grow{@Grow{@Grow{@Grow{@Grow{@Grow{@Grow{@Grow{@b{Information technology
25 @Em Programming}}}}}}}}}}
26
27 @noparanum@Swiss{@Grow{@Grow{@Grow{@Grow{@Grow{@Grow{@Grow{@Grow{@b{Languages @Em Ada}}}}}}}}}}
28
29 @noparanum@ @*@comment{Some vertical whitespace}
30 @ @*
31 @ @*
32
33 @LabeledSectionNoBreak{General}
34 @Comment{$Date: 2006/10/19 20:44:08 $}
35
36 @Comment{$Source: e:\\cvsroot/ARM/Source/01.mss,v $}
37 @Comment{$Revision: 1.57 $}
38
39 @begin{Intro}
40 Ada is a programming language designed to support the construction of
41 long-lived, highly reliable software systems.
42 The language includes facilities to define
43 packages
44 of related types, objects, and operations.
45 The packages may be parameterized
46 and the types may be extended to support the construction of libraries
47 of reusable, adaptable software components. The operations
48 may be implemented as subprograms using conventional sequential
49 control structures, or as entries that include synchronization
50 of concurrent threads of control as part of their invocation.
51 The language treats modularity in the physical
52 sense as well, with a facility to support separate compilation.
53
54 The language includes a complete facility for
55 the support of real-time, concurrent programming.
56 Errors can be signaled as exceptions and handled explicitly.
57 The language also
58 covers systems programming; this requires precise control over the
59 representation of data and access to system-dependent properties. Finally,
60 a predefined environment of standard packages is provided, including
61 facilities for, among others, input-output, string manipulation,
62 numeric elementary functions, and random number generation.
63 @begin{Discussion}
64 @ChgRef{Version=[2],Kind=[Revised]}
65 This Annotated Ada Reference Manual (AARM) contains the entire text of
66 the Ada Reference Manual @Chg{Version=[2],New=[ with Amendment 1 (the Ada 2005 RM],Old=[(RM95]}),
67 plus certain annotations.
68 The annotations give a more in-depth analysis of the language.
69 They describe the reason for each non-obvious rule,
70 and point out interesting ramifications of the rules
71 and interactions among the rules
72 (interesting to language lawyers, that is).
73 Differences between Ada 83@Chg{Version=[2],New=[, Ada 95, and Ada 2005],Old=[ and Ada 95]}
74 are listed.
75 (The text you are reading now is an annotation.)
76
77 @ChgRef{Version=[2],Kind=[Revised]}
78 The AARM stresses detailed correctness and uniformity over
79 readability and understandability.
80 We're not trying to make the language @lquotes@;appear@rquotes@; simple here;
81 on the contrary, we're trying to expose hidden complexities,
82 so we can more easily detect language bugs.
83 The @Chg{Version=[2],New=[Ada 2005 RM],Old=[RM95]}, on the other hand, is intended to be a more
84 readable document for programmers.
85
86 @Leading@keepnext@;The annotations in the AARM are as follows:
87 @begin{Itemize}
88 @ChgRef{Version=[2],Kind=[Revised]}
89 Text that is logically redundant is shown
90 @Redundant[in square brackets, like this].
91 Technically, such text could be written as a @NotesName
92 in the @Chg{Version=[2],New=[Ada 2005 RM (and the Ada 95 RM before it)],Old=[RM95]}, since it
93 is really a theorem that can
94 be proven from the non-redundant rules of the language.
95 We use the square brackets instead when it seems to make the
96 @Chg{Version=[2],New=[Ada 2005 RM],Old=[RM95]} more readable.
97
98 The rules of the language (and some AARM-only text) are categorized,
99 and placed under certain @i{sub-headings} that indicate
100 the category.
101 For example, the distinction between @ResolutionName@;s
102 and @LegalityName@;s is particularly important,
103 as explained in @RefSecNum{The Context of Overload Resolution}.
104
105 Text under the following sub-headings appears in both documents:
106 @begin(Inneritemize)
107 The unlabeled text at the beginning of each clause or subclause,
108
109 @SyntaxTitle,
110
111 @ResolutionTitle,
112
113 @LegalityTitle,
114
115 @StaticSemTitle,
116
117 @LinkTimeTitle,
118
119 @RunTimeTitle,
120
121 @BoundedTitle,
122
123 @ErronTitle,
124
125 @ImplReqTitle,
126
127 @DocReqTitle,
128
129 @MetricsTitle,
130
131 @ImplPermTitle,
132
133 @ImplAdviceTitle,
134
135 @NotesTitle,
136
137 @ExamplesTitle.
138 @end(Inneritemize)
139
140 @ChgRef{Version=[2],Kind=[Revised]}
141 Text under the following sub-headings
142 does not appear in the @Chg{Version=[2],New=[Ada 2005 RM],Old=[RM95]}:
143 @begin(Inneritemize)
144 @MetaRulesTitle,
145
146 @Inconsistent83Title,
147
148 @Incompatible83Title,
149
150 @Extend83Title,
151
152 @ChgRef{Version=[2],Kind=[Revised]}
153 @DiffWord83Title@Chg{Version=[2],New=[,],Old=[.]}
154
155 @ChgRef{Version=[2],Kind=[Added]}
156 @Chg{Version=[2],New=[@Inconsistent95Title,],Old=[]}
157
158 @ChgRef{Version=[2],Kind=[Added]}
159 @Chg{Version=[2],New=[@Incompatible95Title,],Old=[]}
160
161 @ChgRef{Version=[2],Kind=[Added]}
162 @Chg{Version=[2],New=[@Extend95Title,],Old=[]}
163
164 @ChgRef{Version=[2],Kind=[Added]}
165 @Chg{Version=[2],New=[@DiffWord95Title.],Old=[]}
166 @end(Inneritemize)
167
168 The AARM also includes the following kinds of annotations.
169 These do not necessarily annotate the immediately preceding
170 rule, although they often do.
171 @end{Itemize}
172 @end{Discussion}
173 @begin{Reason}
174 An explanation of why a certain rule is necessary,
175 or why it is worded in a certain way.
176 @end{Reason}
177 @begin{Ramification}
178 An obscure ramification of the rules that is of interest
179 only to language lawyers.
180 (If a ramification of the rules is of interest to programmers,
181 then it appears under @NotesTitle.)
182 @end{Ramification}
183 @begin{TheProof}
184 An informal proof explaining how a given
185 @NotesName or
186 @Redundant[marked-as-redundant] piece of text
187 follows from the other rules of the language.
188 @end{TheProof}
189 @begin{ImplNote}
190 A hint about how to implement a feature, or a particular potential
191 pitfall that an implementer needs to be aware of.
192
193 @b{Change:} Change annotations are not used in this version. Changes from
194 previous versions have been removed. Changes in this version are marked with
195 versioned paragraph numbers, as explained in the
196 @lquotes@;Corrigendum Changes@rquotes@; clause of the
197 @lquotes@;Introduction@rquotes@;.
198 @end{ImplNote}
199
200 @begin{Discussion}
201 Other annotations not covered by the above.
202 @end{Discussion}
203 @begin{Honest}
204 A rule that is considered logically necessary to the definition of the
205 language, but which is so obscure or pedantic that only a language
206 lawyer would care.
207 These are the only annotations that could be considered part of the
208 language definition.
209 @end{Honest}
210 @begin{GlossaryMarker}
211 The text of a Glossary entry @em this text will also appear
212 in @RefSec{Glossary}.
213 @end{GlossaryMarker}
214 @begin{Discussion}
215 @ChgRef{Version=[2],Kind=[Revised]}
216 In general, @Chg{Version=[2],New=[the Ada 2005 RM],Old=[RM95]} text appears in the normal font,
217 whereas AARM-only text appears in a smaller font.
218 @NotesName@;s also appear in the smaller font,
219 as recommended by ISO/IEC style guidelines.
220 Ada examples are also usually printed in a smaller font.
221
222 If you have trouble finding things, be sure to use the index.
223 @Defn{italics, like this}
224 Each defined term appears there,
225 and also in @i{italics, like this}.
226 Syntactic categories defined in BNF are also indexed.
227
228 A definition marked @lquotes@;[distributed]@rquotes@; is the main definition for a
229 term whose complete definition is given in pieces distributed
230 throughout the document.
231 The pieces are marked @lquotes@;[partial]@rquotes@;
232 or with a phrase explaining what cases the partial definition applies
233 to.
234 @end{Discussion}
235 @end{Intro}
236
237 @LabeledClause{Scope}
238
239
240 @begin{Intro}
241 This International Standard specifies the form and meaning of programs
242 written in Ada.
243 Its purpose is to promote the portability of Ada programs to a variety
244 of data processing systems.
245 @end{Intro}
246
247 @LabeledSubClause{Extent}
248
249 @begin{Intro}
250 @Leading@keepnext@;This International Standard specifies:
251 @begin(Itemize)
252 The form of a program written in Ada;
253
254 The effect of translating and executing such a program;
255
256 The manner in which program units may be combined to form Ada
257 programs;
258
259 The language-defined library units that a conforming implementation
260 is required to supply;
261
262 The permissible variations within the standard, and the manner in
263 which they are to be documented;
264
265 Those violations of the standard that a conforming implementation
266 is required to detect, and the effect of attempting to translate or
267 execute a program containing such violations;
268
269 Those violations of the standard that a conforming implementation
270 is not required to detect.
271 @end(Itemize)
272
273 @begin{Wide}
274 @Leading@keepnext@;This International Standard does not specify:
275 @end{Wide}
276 @begin(Itemize)
277 The means whereby a program written in Ada is transformed into
278 object code executable by a processor;
279
280 The means whereby translation or execution of programs is invoked
281 and the executing units are controlled;
282
283 The size or speed of the object code, or the relative execution
284 speed of different language constructs;
285
286 The form or contents of any listings produced by implementations;
287 in particular, the form or contents of error or warning messages;
288
289 The effect of unspecified execution.
290
291 The size of a program or program unit that will exceed the capacity
292 of a particular conforming implementation.
293 @end(Itemize)
294 @end{Intro}
295
296 @LabeledSubClause{Structure}
297
298 @begin{Intro}
299 This International Standard contains thirteen sections,
300 fourteen annexes,
301 and an index.
302
303 @Leading@Defn{core language}
304 The @i{core} of the Ada language consists of:
305 @begin{Itemize}
306 Sections 1 through 13
307
308 @RefSec{Predefined Language Environment}
309
310 @RefSec{Interface to Other Languages}
311
312 @RefSec{Obsolescent Features}
313 @end{Itemize}
314
315 @begin{Wide}
316 @Leading@Defn{Specialized Needs Annexes}
317 @Defn2{Term=[Annex],Sec=(Specialized Needs)}
318 @Defn{application areas}
319 The following @i{Specialized Needs Annexes}
320 define features that are needed by certain
321 application areas:
322 @end{Wide}
323 @begin{Itemize}
324 @RefSec{Systems Programming}
325
326 @RefSec{Real-Time Systems}
327
328 @RefSec{Distributed Systems}
329
330 @RefSec{Information Systems}
331
332 @RefSec{Numerics}
333
334 @RefSec{High Integrity Systems}
335 @end{Itemize}
336
337 @begin{Wide}
338 @Leading@Defn{normative}
339 @Defn2{Term=[Annex],Sec=(normative)}
340 The core language and the Specialized Needs Annexes are normative,
341 except that the material in each of the items listed below
342 is informative:
343 @end{Wide}
344 @begin(Itemize)
345 Text under a NOTES or Examples heading.
346
347 Each clause or subclause whose title starts with the word @lquotes@;Example@rquotes@;
348 or @lquotes@;Examples@rquotes@;.
349 @end(Itemize)
350
351 All implementations shall conform to the core language.
352 In addition, an implementation may conform separately to one or more
353 Specialized Needs Annexes.
354
355 @begin{Wide}
356 @Leading@Keepnext@Defn{informative}
357 @IndexSee{Term=[non-normative],See=(informative)}
358 @Defn2{Term=[Annex],Sec=(informative)}
359 The following Annexes are informative:
360 @end{Wide}
361 @begin{Itemize}
362 @RefSec{Language-Defined Attributes}
363
364 @RefSec{Language-Defined Pragmas}
365
366 @RefSec{Implementation-Defined Characteristics}
367
368 @RefSec{Glossary}
369
370 @RefSec{Syntax Summary}
371 @end{Itemize}
372 @begin(Discussion)
373 The idea of the Specialized Needs Annexes is that implementations
374 can choose to target certain application areas.
375 For example, an implementation specifically targeted to embedded
376 machines might support the application-specific features for
377 Real-time Systems, but not the application-specific features
378 for Information Systems.
379
380 The Specialized Needs Annexes extend the core language only in ways that
381 users, implementations, and standards bodies are allowed to extend the
382 language;
383 for example, via additional library units,
384 attributes, representation items (see @RefSecNum{Operational and Representation Items}),
385 @nt{pragma}s,
386 and constraints on semantic details that are left unspecified by the
387 core language.
388 Many implementations already provide much of the functionality defined
389 by Specialized Needs Annexes;
390 our goal is to increase uniformity among implementations by defining
391 standard ways of providing the functionality.
392
393 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00114-01]}@ChgNote{Make consistent with 18009}
394 We recommend that the @Chg{Version=[2],New=[certification],Old=[validation]}
395 procedures allow implementations to
396 @Chg{Version=[2],New=[certify],Old=[validate]} the core language, plus any
397 set of the Specialized Needs Annexes. We recommend that
398 implementations @i{not} be allowed to @Chg{Version=[2],New=[certify],Old=[validate]}
399 a portion of one of the Specialized Needs Annexes,
400 although implementations can, of course, provide @Chg{Version=[2],
401 New=[uncertified],Old=[unvalidated]} support for such
402 portions. We have designed the Specialized Needs Annexes assuming that
403 this recommendation is followed. Thus, our decisions about what to
404 include and what not to include in those annexes are
405 based on the assumption that each
406 annex is @Chg{Version=[2],New=[certified],Old=[validated]} in an
407 @lquotes@;all-or-nothing@rquotes@; manner.
408
409 An implementation may, of course,
410 support extensions that are different from
411 (but possibly related to)
412 those defined by one of the Specialized Needs Annexes.
413 We recommend that, where appropriate, implementations do this by adding
414 library units that are children of existing language-defined library
415 packages.
416
417 An implementation should not provide extensions that conflict with
418 those defined in the Specialized Needs Annexes, in the following sense:
419 Suppose an
420 implementation supports a certain error-free program that uses only
421 functionality defined in the core and in the Specialized Needs Annexes.
422 The implementation should ensure that that program will still be error
423 free in some possible full implementation of all of the Specialized Needs
424 Annexes, and that the semantics of the program will not change.
425 For example, an implementation should not provide a package
426 with the same name as one defined in one of the Specialized Needs Annexes,
427 but that behaves
428 differently, @i{even if that implementation does not claim
429 conformance to that Annex}.
430
431 Note that the Specialized Needs Annexes do not conflict with each
432 other; it is the intent that a single implementation can conform
433 to all of them.
434 @end(Discussion)
435
436 @begin{Wide}
437 Each section is divided into clauses and subclauses that have a
438 common structure.
439 Each section, clause, and subclause first introduces its subject.
440 After the introductory text,
441 text is labeled with the following headings:
442 @end{Wide}
443 @end{Intro}
444
445 @begin{MetaRules}
446 These are not rules of the language, but guiding principles or goals used in
447 defining the rules of the language.
448 In some cases, the goal is only partially met;
449 such cases are explained.
450
451 @ChgRef{Version=[2],Kind=[Revised]}
452 This is not part of the definition of the language,
453 and does not appear in the @Chg{Version=[2],New=[Ada 2005 RM],Old=[RM95]}.
454 @end{MetaRules}
455
456 @begin{Syntax}
457 @begin{SyntaxText}
458 @Defn2{Term=[syntax], Sec=(under Syntax heading)}
459 @Defn2{Term=[grammar], Sec=(under Syntax heading)}
460 @Defn2{Term=[context free grammar], Sec=(under Syntax heading)}
461 @Defn2{Term=[BNF (Backus-Naur Form)], Sec=(under Syntax heading)}
462 @Defn2{Term=[Backus-Naur Form (BNF)], Sec=(under Syntax heading)}
463 Syntax rules (indented).
464 @end{SyntaxText}
465 @end{Syntax}
466
467 @begin{Resolution}
468 @Defn{name resolution rules}
469 @Defn{overloading rules}
470 @Defn{resolution rules}
471 Compile-time rules that are used in name resolution,
472 including overload resolution.
473 @begin{Discussion}
474 These rules are observed at compile time.
475 (We say @lquotes@;observed@rquotes@; rather than @lquotes@;checked,@rquotes@;
476 because these rules are not individually checked.
477 They are really just part of the @LegalityName@;s in Section 8
478 that require exactly one interpretation of each constituent
479 of a complete context.)
480 The only rules used in overload resolution are the @SyntaxName@;s
481 and the @ResolutionName@;s.
482
483 When dealing with non-overloadable declarations it sometimes makes no
484 semantic difference whether a given rule is a @ResolutionName
485 or a @LegalityName,
486 and it is sometimes difficult to decide which it should be.
487 We generally make a given rule a @ResolutionName only if it has to be.
488 For example,
489 @lquotes@;The @nt{name}, if any, in a @nt{raise_statement} shall be the @nt{name}
490 of an exception.@rquotes@;
491 is under @lquotes@;@LegalityTitle.@rquotes@;
492 @end{Discussion}
493 @end{Resolution}
494
495 @begin{Legality}
496 @Defn{legality rules}
497 @Defn{compile-time error}
498 @Defn2{Term=[error], Sec=(compile-time)}
499 Rules that are enforced at compile time.
500 @Defn2{Term=[legal], Sec=(construct)}
501 @Defn2{Term=[illegal], Sec=(construct)}
502 A construct is @i{legal} if it obeys all of the @LegalityName@;s.
503 @begin{Discussion}
504 These rules are not used in overload resolution.
505
506 Note that run-time errors are always attached to exceptions;
507 for example, it is not @lquotes@;illegal@rquotes@; to divide by zero,
508 it just raises an exception.
509 @end{Discussion}
510 @end{Legality}
511
512 @begin{StaticSem}
513 @Defn{static semantics}
514 @Defn{compile-time semantics}
515 A definition of the compile-time effect of each construct.
516 @begin{Discussion}
517 The most important compile-time effects represent the effects
518 on the symbol table associated with declarations (implicit or
519 explicit). In addition, we use this heading as a bit of a grab
520 bag for equivalences, package specifications, etc.
521 For example, this is where we put statements like so-and-so is
522 equivalent to such-and-such. (We ought to try to really mean it when we say
523 such things!)
524 Similarly, statements about magically-generated implicit declarations
525 go here.
526 These rules are generally written as statements of fact about the
527 semantics, rather than as a you-shall-do-such-and-such sort of thing.
528 @end{Discussion}
529 @end{StaticSem}
530
531 @begin{LinkTime}
532 @Defn{post-compilation error}
533 @Defn{post-compilation rules}
534 @IndexSee{Term=[link-time error],See=(post-compilation error)}
535 @Defn2{Term=[error], Sec=(link-time)}
536 Rules that are enforced before running a partition.
537 @Defn2{Term=[legal], Sec=(partition)}
538 @Defn2{Term=[illegal], Sec=(partition)}
539 A partition is legal if its compilation units are legal
540 and it obeys all of the @LinkTimeName@;s.
541 @begin{Discussion}
542 It is not specified exactly when these rules are checked, so
543 long as they are checked for any given partition before that partition starts
544 running. An implementation may choose to check some such rules at compile
545 time, and reject @nt{compilation_unit}s accordingly.
546 Alternatively, an implementation may check such rules when the partition is
547 created (usually known as @lquotes@;link time@rquotes@;),
548 or when the partition is mapped to a particular piece of hardware (but before
549 the partition starts running).
550 @end{Discussion}
551 @end{LinkTime}
552
553 @begin{RunTime}
554 @Defn{dynamic semantics}
555 @Defn{run-time semantics}
556 @Defn{run-time error}
557 @Defn2{Term=[error], Sec=(run-time)}
558 A definition of the run-time effect of each construct.
559 @begin{Discussion}
560 This heading describes what happens at run time.
561 Run-time checks,
562 which raise exceptions upon failure,
563 are described here.
564 Each item that involves a run-time check is marked with the name
565 of the check @em these are the same check names that are used in a
566 @nt{pragma} Suppress.
567 Principle: Every check should have a name,
568 usable in a @nt{pragma} Suppress.
569 @end{Discussion}
570 @end{RunTime}
571
572 @begin{Bounded}
573 @Defn{bounded error}
574 @SeeAlso{Primary=[error], Other=(bounded error)}
575 Situations that result in bounded (run-time) errors
576 (see @RefSecNum{Classification of Errors}).
577 @begin{Discussion}
578 The @lquotes@;bounds@rquotes@; of each such error are described here @em
579 that is, we characterize the set of all possible behaviors that can
580 result from a bounded error occurring at run time.
581 @end{Discussion}
582 @end{Bounded}
583
584 @begin{Erron}
585 @Defn{erroneous execution}
586 @SeeAlso{Primary=[error], Other=(erroneous execution)}
587 Situations that result in erroneous execution
588 (see @RefSecNum{Classification of Errors}).
589 @end{Erron}
590
591 @begin{ImplReq}
592 @Defn{implementation requirements}
593 Additional requirements for conforming implementations.
594 @begin{Discussion}
595 ...as opposed to rules imposed on the programmer.
596 An example might be,
597 @lquotes@;The smallest representable duration, Duration'Small,
598 shall not be greater than twenty milliseconds.@rquotes@;
599
600 It's really just an issue of how the rule is worded.
601 We could write the same rule as @lquotes@;The smallest representable duration is
602 an implementation-defined value less than or equal to 20 milliseconds@rquotes@;
603 and then it would be under @lquotes@;@StaticSemTitle.@rquotes@;
604 @end{Discussion}
605 @end{ImplReq}
606
607 @begin{DocReq}
608 @Defn{documentation requirements}
609 Documentation requirements for conforming implementations.
610 @begin{Discussion}
611 These requirements are beyond those that are implicitly specified by
612 the phrase @lquotes@;implementation defined@rquotes@;. The
613 latter require documentation as well, but we don't repeat these cases
614 under this heading. Usually this heading is used for when the
615 description of the documentation requirement is longer and does not
616 correspond directly to one, narrow normative sentence.
617 @end{Discussion}
618 @end{DocReq}
619
620 @begin{Metrics}
621 @Defn{metrics}
622 Metrics that are specified for the time/space properties of the execution
623 of certain language constructs.
624 @end{Metrics}
625
626 @begin{ImplPerm}
627 @Defn{implementation permissions}
628 Additional permissions given to the implementer.
629 @begin{Discussion}
630 For example, @lquotes@;The implementation is allowed to impose further
631 restrictions on the record aggregates allowed in code statements.@rquotes@;
632 When there are restrictions on the permission,
633 those restrictions are given here also.
634 For example, @lquotes@;An implementation is allowed to restrict the kinds of
635 subprograms that are allowed to be main subprograms.
636 However, it shall support at least parameterless procedures.@rquotes@;
637 @em we don't split this up between here and @lquotes@;@ImplReqTitle.@rquotes@;
638 @end{Discussion}
639 @end{ImplPerm}
640
641 @begin{ImplAdvice}
642 @Defn{implementation advice}
643 @Defn{advice}
644 Optional advice given to the implementer.
645 The word @lquotes@;should@rquotes@; is used to indicate that the advice is
646 a recommendation, not a requirement.
647 It is implementation defined
648 whether or not a given recommendation is obeyed.
649 @ChgImplDef{Version=[2],Kind=[Revised],Text=[Whether or not each recommendation
650 given in @ImplAdviceTitle is followed@Chg{Version=[2],
651 New=[ @em see @RefSec{Implementation Advice} for a listing],Old=[]}.]}
652 @begin{Discussion}
653 @ChgRef{Version=[1],Kind=[Revised]}
654 The advice generally shows the intended implementation, but
655 the implementer is free to ignore it.
656 The implementer is the sole arbiter of whether or not the advice has
657 been obeyed, if not, whether the reason is a good one,
658 and whether the required documentation is sufficient.
659 @Chg{Version=[1],New=[],Old=[@PDefn2{Term=[ACVC],Sec=(Ada Compiler Validation Capability)}
660 @PDefn2{Term=[Ada Compiler Validation Capability],Sec=(ACVC)}]}
661 It would be wrong for the @Chg{Version=[1],New=[ACATS],Old=[ACVC]} to enforce any of
662 this advice.
663
664 For example,
665 @lquotes@;Whenever possible, the implementation should choose a value no
666 greater than fifty microseconds for the smallest representable duration,
667 Duration'Small.@rquotes@;
668
669 We use this heading, for example, when the rule is so low level or
670 implementation-oriented as to be untestable.
671 We also use this heading when we wish to encourage implementations
672 to behave in a certain way in most cases, but we do not wish to
673 burden implementations by requiring the behavior.
674 @end{Discussion}
675 @end{ImplAdvice}
676
677 @begin{Notes}
678 @Defn{notes}
679 Notes emphasize consequences of the rules
680 described in the (sub)clause or elsewhere.
681 This material is informative.
682 @end{Notes}
683
684 @begin{Examples}
685 Examples illustrate the possible forms of the constructs described.
686 This material is informative.
687 @begin{Discussion}
688 @ @* @Comment{Two blank lines: why? Because it was in the original.}
689 @*
690 The next three headings list all language changes between Ada 83
691 and Ada 95. Language changes are any change that changes the set of
692 text strings that are legal Ada programs, or changes the meaning of
693 any legal program.
694 Wording changes, such as changes in terminology, are not language
695 changes.
696 Each language change falls into one of the following three
697 categories:
698 @end{Discussion}
699 @end{Examples}
700
701 @begin{Inconsistent83}
702 @Defn{inconsistencies with Ada 83}
703 This heading lists all of the upward inconsistencies between Ada 83 and Ada
704 95. Upward inconsistencies are situations in which a legal Ada 83 program
705 is a legal Ada 95 program with different semantics.
706 This type of upward incompatibility is the worst type for users,
707 so we only tolerate it in rare situations.
708
709 (Note that the semantics of a program is not the same thing as the
710 behavior of the program.
711 Because of Ada's indeterminacy,
712 the @lquotes@;semantics@rquotes@; of a given feature describes a @i{set} of behaviors
713 that can be exhibited by that feature.
714 The set can contain more than one allowed behavior.
715 Thus, when we ask whether the semantics changes,
716 we are asking whether the set of behaviors changes.)
717
718 @ChgRef{Version=[2],Kind=[Revised]}
719 This is not part of the definition of the language,
720 and does not appear in the @Chg{Version=[2],New=[Ada 95 or Ada 2005 RM],Old=[RM95]}.
721 @end{Inconsistent83}
722
723 @begin{Incompatible83}
724 @Defn{incompatibilities with Ada 83}
725 This heading lists all of the upward incompatibilities between Ada 83
726 and Ada 95, except for the ones listed under @lquotes@;@Inconsistent83Title@rquotes@;
727 above. These are the situations in which a legal Ada 83 program is
728 illegal in Ada 95.
729 We do not generally consider a change that turns erroneous execution
730 into an exception, or into an illegality, to be upwardly incompatible.
731
732 @ChgRef{Version=[2],Kind=[Revised]}
733 This is not part of the definition of the language,
734 and does not appear in the @Chg{Version=[2],New=[Ada 95 or Ada 2005 RM],Old=[RM95]}.
735 @end{Incompatible83}
736
737 @begin{Extend83}
738 @Defn{extensions to Ada 83}
739 This heading is used to list all upward compatible language changes;
740 that is, language extensions.
741 These are the situations in which a legal Ada 95 program is not a
742 legal Ada 83 program.
743 The vast majority of language changes fall into this category.
744
745 @ChgRef{Version=[2],Kind=[Revised]}
746 This is not part of the definition of the language,
747 and does not appear in the @Chg{Version=[2],New=[Ada 95 or Ada 2005 RM],Old=[RM95]}.
748
749 @Leading@ @* @Comment{Two blank lines: why? Because it was in the original.}
750 @*
751 As explained above,
752 the next heading does not represent any language change:
753 @end{Extend83}
754
755 @begin{DiffWord83}
756 @ChgRef{Version=[2],Kind=[Revised]}
757 @Defn{wording changes from Ada 83}
758 This heading lists some of the non-semantic changes between @Chg{Version=[2],
759 New=[the Ada 83 RM],Old=[RM83]} and
760 the @Chg{Version=[2],New=[the Ada 95 RM],Old=[RM95]}.
761 It is incomplete; we have not attempted to list all wording
762 changes, but only the @lquotes@;interesting@rquotes@; ones.
763
764 @ChgRef{Version=[2],Kind=[Revised]}
765 This is not part of the definition of the language,
766 and does not appear in the @Chg{Version=[2],New=[Ada 95 or Ada 2005 RM],Old=[RM95]}.
767 @end{DiffWord83}
768
769 @begin{Discussion}
770 @ChgRef{Version=[2],Kind=[AddedNormal]}
771 @ChgAdded{Version=[2],Type=[Leading],Text=[@ @* @Comment{Two blank lines: why? Because it was in the Ada 95 original.}
772 @*
773 The next three headings list all language changes between Ada 95
774 and Ada 2005 (the language defined by the Ada 95 standard plus
775 Technical Corrigendum 1 plus Amendment 1).
776 Each language change falls into one of the following three
777 categories:]}
778 @end{Discussion}
779
780 @begin{Inconsistent95}
781 @ChgRef{Version=[2],Kind=[AddedNormal]}
782 @ChgAdded{Version=[2],Text=[@Defn{inconsistencies with Ada 95}
783 This heading lists all of the upward inconsistencies between Ada 95 and Ada
784 2005. Upward inconsistencies are situations in which a legal Ada 95 program
785 is a legal Ada 2005 program with different semantics.]}
786
787 @ChgRef{Version=[2],Kind=[AddedNormal]}
788 @ChgAdded{Version=[2],Text=[Inconsistencies marked with
789 @b[Corrigendum:]@Defn{Corrigendum} are corrections to the original Ada 95
790 definition introduced by Corrigendum 1. Inconsistencies marked with
791 @b[Amendment Correction:]@Defn{Amendment Correction} are corrections to the
792 original Ada 95 definition added by Amendment 1. Formally, these are
793 inconsistencies caused by Ada Issues classified as Binding Interpretations;
794 implementations of Ada 95 are supposed to follow these corrections, not the
795 original flawed language definition. Thus, these strictly speaking are not
796 inconsistencies between Ada 95 and Ada 2005. Practically, however, they very
797 well may be, as early Ada 95 implementations may not follow the recommendation.
798 Inconsistencies so marked are not portable between Ada 95 implementations,
799 while usually Ada 2005 will have more clearly defined behavior. Therefore, we
800 document these for completeness.]}
801
802 @ChgRef{Version=[2],Kind=[AddedNormal]}
803 @ChgAdded{Version=[2],Text=[This is not part of the definition of the language,
804 and does not appear in the Ada 2005 RM.]}
805 @end{Inconsistent95}
806
807 @begin{Incompatible95}
808 @ChgRef{Version=[2],Kind=[AddedNormal]}
809 @ChgAdded{Version=[2],Text=[@Defn{incompatibilities with Ada 95}
810 This heading lists all of the upward incompatibilities between Ada 95
811 and Ada 2005, except for the ones listed under @lquotes@;@Inconsistent95Title@rquotes@;
812 above. These are the situations in which a legal Ada 95 program is
813 illegal in Ada 2005.]}
814
815 @ChgRef{Version=[2],Kind=[AddedNormal]}
816 @ChgAdded{Version=[2],Text=[As with inconsistencies, incompatibilities
817 marked with @b[Corrigendum:]
818 are corrections to the original Ada 95 definition introduced by Corrigendum
819 1. Incompatibilities marked with @b[Amendment Correction:] are corrections
820 to the original Ada 95 definition added by Amendment 1. Formally, these are
821 incompatibilities caused by Ada Issues classified as Binding Interpretations;
822 implementations of Ada 95 are supposed to follow these corrections, not the
823 original flawed language definition. Thus,
824 these strictly speaking are not incompatibilities between Ada 95 and Ada 2005.
825 Practically, however, they very well may be, as early Ada 95 implementations
826 may not follow the recommendation. Therefore, some Ada 95 implementations
827 may be able to compile the examples, while others may not. In constrast,
828 Ada 2005 compilers will have consistent behavior. Therefore, we document these
829 for completeness.]}
830
831 @ChgRef{Version=[2],Kind=[AddedNormal]}
832 @ChgAdded{Version=[2],Text=[This is not part of the definition of the language,
833 and does not appear in the Ada 2005 RM.]}
834 @end{Incompatible95}
835
836 @begin{Extend95}
837 @ChgRef{Version=[2],Kind=[AddedNormal]}
838 @Chg{Version=[2],New=[@Defn{extensions to Ada 95}
839 This heading is used to list all upward compatible language changes;
840 that is, language extensions.
841 These are the situations in which a legal Ada 2005 program is not a
842 legal Ada 95 program.
843 The vast majority of language changes fall into this category.],Old=[]}
844
845 @ChgRef{Version=[2],Kind=[AddedNormal]}
846 @ChgAdded{Version=[2],Text=[As with incompatibilities, extensions
847 marked with @b[Corrigendum:]
848 are corrections to the original Ada 95 definition introduced by Corrigendum
849 1. Extensions marked with @b[Amendment Correction:] are corrections
850 to the original Ada 95 definition added by Amendment 1. Formally, these are
851 extensions allowed by Ada Issues classified as Binding Interpretations.
852 As corrections, implementations of Ada 95 are allowed to implement these
853 extensions. Thus, these strictly speaking are not extensions of Ada 95;
854 they're part of Ada 95. Practically, however, they very well may be extensions,
855 as early Ada 95 implementations may not implement the extension. Therefore,
856 some Ada 95 implementations may be able to compile the examples, while others
857 may not. In constrast, Ada 2005 compilers will always support the extensions.
858 Therefore, we document these for completeness.]}
859
860 @ChgRef{Version=[2],Kind=[AddedNormal]}
861 @Chg{Version=[2],New=[This is not part of the definition of the language,
862 and does not appear in the Ada 2005 RM.],Old=[]}
863
864 @ChgRef{Version=[2],Kind=[AddedNormal]}
865 @ChgAdded{Version=[2],Type=[Leading],Text=[@ @* @Comment{Two blank lines: why? Because it was in the Ada 95 original.}
866 @*
867 As explained above,
868 the next heading does not represent any language change:]}
869 @end{Extend95}
870
871 @begin{DiffWord95}
872 @ChgRef{Version=[2],Kind=[AddedNormal]}
873 @Chg{Version=[2],New=[@Defn{wording changes from Ada 95}
874 This heading lists some of the non-semantic changes between the Ada 95 RM and
875 the Ada 2005 RM. This heading lists only @lquotes@;interesting@rquotes@; changes
876 (for instance, editorial corrections are not listed). Changes which
877 come from Technical Corrigendum 1 are marked @b{Corrigendum}; unmarked changes
878 come from Amendment 1.],Old=[]}
879
880 @ChgRef{Version=[2],Kind=[AddedNormal]}
881 @Chg{Version=[2],New=[This is not part of the definition of the language,
882 and does not appear in the Ada 2005 RM.],Old=[]}
883 @end{DiffWord95}
884
885 @LabeledSubClause{Conformity of an Implementation with the Standard}
886
887 @begin{ImplReq}
888
889 @Leading@Keepnext@Defn2{Term=[conformance],Sec=(of an implementation with the Standard)}
890 A conforming implementation shall:
891 @begin{Discussion}
892 @Defn{implementation}
893 The @i{implementation} is the software and hardware that implements
894 the language.
895 This includes compiler, linker, operating system, hardware, etc.
896
897 We first define what it means to @lquotes@;conform@rquotes@; in general @em
898 basically, the implementation has to properly implement the normative
899 rules given throughout the standard.
900 Then we define what it means to conform to a Specialized Needs
901 Annex @em the implementation must support the core features plus the
902 features of that Annex.
903 Finally, we define what it means to @lquotes@;conform to the Standard@rquotes@; @em
904 this requires support for the core language,
905 and allows partial (but not conflicting) support for
906 the Specialized Needs Annexes.
907 @end{Discussion}
908 @begin(Itemize)
909 Translate and correctly execute
910 legal programs written in Ada,
911 provided that they are not so large as to exceed the capacity of
912 the implementation;
913
914 Identify all programs or program units
915 that are so large as to exceed the capacity of
916 the implementation (or raise an appropriate
917 exception at run time);
918 @ImplDef{Capacity limitations of the implementation.}
919
920 Identify all programs or program units that contain
921 errors whose detection is required by this
922 International Standard;
923 @begin{Discussion}
924 Note that we no longer use the term @lquotes@;rejection@rquotes@; of
925 programs or program units.
926 We require that programs or program units with errors or that
927 exceed some capacity limit be @lquotes@;identified@rquotes@;.
928 The way in which errors or capacity problems are reported is not
929 specified.
930
931 An implementation is allowed to use standard error-recovery
932 techniques.
933 We do not disallow such techniques from being used across
934 @nt{compilation_unit} or @nt{compilation} boundaries.
935
936 See also the @ImplReqTitle of @RefSecNum{Program Execution},
937 which disallow the execution of illegal partitions.
938
939 @end{Discussion}
940
941 Supply all language-defined library units required by this
942 International Standard;
943 @begin{ImplNote}
944 An implementation cannot add to or modify the visible part of
945 a language-defined library unit,
946 except where such permission is explicitly granted,
947 unless such modifications are semantically neutral with respect
948 to the client compilation units of the library unit.
949 An implementation defines the contents of the private part and
950 body of language-defined library units.
951
952 An implementation can add @nt{with_clause}s and @nt{use_clause}s,
953 since these modifications are semantically neutral to clients.
954 (The implementation might need @nt{with_clause}s in order to
955 implement the private part, for example.)
956 Similarly, an implementation can add a private part even in cases
957 where a private part is not shown in the standard.
958 Explicit declarations can be provided implicitly or by renaming,
959 provided the changes are semantically neutral.
960
961 @Defn2{Term=[italics],Sec=(implementation-defined)}
962 Wherever in the standard the text of a language-defined library
963 unit contains an italicized phrase starting with
964 @lquotes@;@i{implementation-defined}@rquotes@;, the implementation's version
965 will replace that phrase with some implementation-defined text
966 that is syntactically legal at that place, and follows any other
967 applicable rules.
968
969 Note that modifications are permitted, even if there are other tools
970 in the environment that can detect the changes (such as a program
971 library browser), so long as the modifications make no difference
972 with respect to the static or dynamic semantics of the resulting
973 programs, as defined by the standard.
974 @end{ImplNote}
975
976 Contain no variations except
977 those explicitly permitted by this
978 International Standard, or those that are impossible or impractical
979 to avoid given the implementation's execution environment;
980 @ImplDef{Variations from the standard that are impractical to avoid
981 given the implementation's execution environment.}
982 @begin{Reason}
983 The @lquotes@;impossible or impractical@rquotes@; wording comes from AI-325.
984 It takes some judgement and common sense to interpret this.
985 Restricting compilation units to less than 4 lines is probably
986 unreasonable, whereas restricting them to less than 4 billion lines
987 is probably reasonable (at least given today's technology).
988 We do not know exactly where to draw the line,
989 so we have to make the rule vague.
990 @end{Reason}
991
992 Specify all such variations in the manner prescribed
993 by this International Standard.
994 @end(Itemize)
995
996 @begin{Wide}
997 @Leading@keepnext@Defn2{Term=[external effect], Sec=(of the execution of an Ada program)}
998 @Defn2{Term=[effect], Sec=(external)}
999 The @i(external effect) of the execution of an Ada program is
1000 defined in terms of its interactions
1001 with its external environment.
1002 @Defn{external interaction}
1003 The following are defined as @i(external interactions):
1004 @end{Wide}
1005 @begin(Itemize)
1006 Any interaction with an external file
1007 (see @RefSecNum(External Files and File Objects));
1008
1009 The execution of
1010 certain @nt<code_statement>s
1011 (see @RefSecNum{Machine Code Insertions});
1012 which @nt{code_statement}s cause external interactions
1013 is implementation defined.
1014 @ImplDef{Which @nt{code_statement}s cause external interactions.}
1015
1016 Any call on an imported subprogram
1017 (see @RefSecNum(Interface to Other Languages)),
1018 including any parameters passed to it;
1019
1020 Any result returned or exception
1021 propagated from a main subprogram
1022 (see @RefSecNum(Program Execution))
1023 or an exported subprogram
1024 (see @RefSecNum(Interface to Other Languages)) to an external caller;
1025 @begin{Discussion}
1026 By @lquotes@;result returned@rquotes@; we mean to include function results
1027 and values returned in [@key(in)] @key(out) parameters.
1028
1029 @ChgRef{Version=[1],Kind=[Added],Ref=[8652/0094],ARef=[AI95-00119-01]}
1030 @Chg{Version=[1],New=[The lack of a result from a program that does not terminate
1031 is also included here.],Old=[]}
1032 @end{Discussion}
1033
1034 @Redundant[Any read or update of an atomic or volatile object
1035 (see @RefSecNum(Shared Variable Control));]
1036
1037 The values of imported and exported objects
1038 (see @RefSecNum(Interface to Other Languages)) at the time
1039 of any other interaction with the external environment.
1040 @begin{Honest}
1041 Also other uses of imported and exported entities,
1042 as defined by the implementation,
1043 if the implementation supports such @nt{pragma}s.
1044 @end{Honest}
1045 @end(Itemize)
1046
1047 @begin{Wide}
1048 A conforming implementation
1049 of this International Standard shall produce for the
1050 execution of a given Ada program
1051 a set of interactions with the external environment whose
1052 order and timing are consistent with the definitions and requirements of this
1053 International Standard for the semantics of the given program.
1054 @end{Wide}
1055 @begin{Ramification}
1056 There is no need to produce any of the @lquotes@;internal effects@rquotes@;
1057 defined for the semantics of the program @em all of these
1058 can be optimized away @em so long as an appropriate sequence
1059 of external interactions is produced.
1060 @end{Ramification}
1061 @begin{Discussion}
1062 See also @RefSecNum(Exceptions and Optimization) which specifies
1063 various liberties associated with optimizations in
1064 the presence of language-defined checks,
1065 that could change the external effects that
1066 might be produced. These alternative external effects
1067 are still consistent with the standard, since
1068 @RefSecNum(Exceptions and Optimization) is part of the standard.
1069
1070 Note also that we only require @lquotes@;@i(an appropriate) sequence
1071 of external interactions@rquotes@; rather than @lquotes@;@i(the same) sequence...@rquotes@;
1072 An optimizer may cause a different sequence of external interactions
1073 to be produced than would be produced without the optimizer, so
1074 long as the new sequence still satisfies the requirements
1075 of the standard. For example, optimization might affect
1076 the relative rate of progress of two concurrent tasks, thereby
1077 altering the order in which two external interactions occur.
1078
1079 @ChgRef{Version=[2],Kind=[Revised]}
1080 Note that @Chg{Version=[2],New=[the Ada 83 RM],Old=[RM83]} explicitly
1081 mentions the case of an @lquotes@;exact effect@rquotes@;
1082 of a program, but since so few programs have their effects defined
1083 that exactly,
1084 we don't even mention this @lquotes@;special@rquotes@; case. In particular,
1085 almost any program that uses floating point or tasking has to have
1086 some level
1087 of inexactness in the specification of its effects. And if one
1088 includes aspects of the timing of the external interactions
1089 in the external effect of the program (as is appropriate for a real-time
1090 language), no @lquotes@;exact effect@rquotes@; can be specified.
1091 For example, if two external interactions initiated by a single task
1092 are separated by a @lquotes@;@key(delay) 1.0;@rquotes@; then the language rules
1093 imply that the two external interactions have to be separated in time
1094 by at least one second, as defined by the clock associated with
1095 the @nt<delay_relative_statement>. This in turn implies that
1096 the time at which an external interaction occurs is part of
1097 the characterization of the external interaction, at least in
1098 some cases, again making the specification of the required
1099 @lquotes@;exact effect@rquotes@; impractical.
1100 @end{Discussion}
1101
1102 An implementation that conforms to this Standard shall support each
1103 capability required by the core language as specified.
1104 In addition,
1105 an implementation that conforms to this Standard may conform to one
1106 or more Specialized Needs Annexes (or to none).
1107 Conformance to a Specialized Needs Annex means that each capability
1108 required by the Annex is provided as specified.
1109 @begin{Discussion}
1110 The last sentence defines what it means to say that an
1111 implementation conforms to a Specialized Needs Annex, namely, only
1112 by supporting all capabilities required by the Annex.
1113 @end{Discussion}
1114
1115 An implementation conforming to this International Standard
1116 may provide additional
1117 attributes, library units, and pragmas.
1118 However, it shall not provide any attribute,
1119 library unit, or pragma having the same name
1120 as an attribute, library unit, or pragma (respectively)
1121 specified in a Specialized Needs Annex unless the provided construct
1122 is either as specified in the Specialized Needs Annex or is more
1123 limited in capability than that required by the Annex.
1124 A program that attempts to use an unsupported capability of an Annex
1125 shall either be identified by the implementation before run time or
1126 shall raise an exception at run time.
1127 @begin{Discussion}
1128 The last sentence of the preceding paragraph defines what an
1129 implementation is allowed to do when it does not "conform" to a
1130 Specialized Needs Annex.
1131 In particular, the sentence forbids implementations from providing
1132 a construct with the same name as a corresponding construct in a
1133 Specialized Needs Annex but with a different syntax
1134 (e.g., an extended syntax) or quite different semantics.
1135 The phrase concerning "more limited in capability" is intended to
1136 give permission to provide a partial implementation, such as not
1137 implementing a subprogram in a package or having a restriction not
1138 permitted by an implementation that conforms to the Annex.
1139 For example, a partial implementation of the package Ada.Decimal
1140 might have Decimal.Max_Decimal_Digits as 15 (rather than the
1141 required 18).
1142 This allows a partial implementation to grow to a fully conforming
1143 implementation.
1144
1145 A restricted implementation might be restricted by not providing
1146 some subprograms specified in one of the packages defined by an
1147 Annex.
1148 In this case, a program that tries to use the missing subprogram
1149 will usually fail to compile.
1150 Alternatively, the implementation might declare the subprogram as
1151 abstract, so it cannot be called.
1152 @Defn2{Term=[Program_Error],Sec=(raised by failure of run-time check)}
1153 Alternatively, a subprogram body might be implemented just to raise
1154 Program_Error.
1155 The advantage of this approach is that a program to be run under a
1156 fully conforming Annex implementation can be checked syntactically
1157 and semantically under an implementation that only partially
1158 supports the Annex.
1159 Finally, an implementation might provide a package declaration
1160 without the corresponding body, so that programs can be compiled,
1161 but partitions cannot be built and executed.
1162
1163 To ensure against wrong answers being delivered by a partial
1164 implementation, implementers are required to raise an exception
1165 when a program attempts to use an unsupported capability and this
1166 can be detected only at run time.
1167 For example, a partial implementation of Ada.Decimal might require
1168 the length of the Currency string to be 1, and hence, an
1169 exception would be raised if a subprogram were called in the
1170 package Edited_Output with a length greater than 1.
1171 @end{Discussion}
1172 @end{ImplReq}
1173
1174 @begin{DocReq}
1175 @Defn{implementation defined}
1176 @Defn{unspecified}
1177 @Defn{specified (not!)}
1178 @IndexSee{Term=[implementation-dependent],See=(unspecified)}
1179 @Defn{documentation (required of an implementation)}
1180 Certain aspects of the semantics are defined to be either
1181 @i{implementation defined} or @i{unspecified}.
1182 In such cases, the set of possible effects is specified, and
1183 the implementation may choose any effect in the set.
1184 Implementations shall document their behavior in
1185 implementation-defined situations, but documentation is not required
1186 for unspecified situations.
1187 The implementation-defined characteristics are summarized in
1188 @RefSecNum{Implementation-Defined Characteristics}.
1189 @begin{Discussion}
1190 We used to use the term @lquotes@;implementation dependent@rquotes@;
1191 instead of @lquotes@;unspecified@rquotes@;.
1192 However, that sounded too much like @lquotes@;implementation defined@rquotes@;.
1193 Furthermore, the term @lquotes@;unspecified@rquotes@; is used in the ANSI C and
1194 POSIX standards for this purpose, so that is another advantage.
1195 We also use @lquotes@;not specified@rquotes@; and @lquotes@;not specified by the language@rquotes@;
1196 as synonyms for @lquotes@;unspecified.@rquotes@;
1197 The documentation requirement is the only difference between
1198 implementation defined and unspecified.
1199
1200 Note that the @lquotes@;set of possible effects@rquotes@; can be @lquotes@;all imaginable
1201 effects@rquotes@;, as is the case with erroneous execution.
1202 @end{Discussion}
1203
1204 The implementation may choose to document implementation-defined behavior
1205 either by documenting what happens in general,
1206 or by providing some mechanism for the user to determine what
1207 happens in a particular case.
1208 @begin(Discussion)
1209 For example, if the standard says that library unit elaboration order
1210 is implementation defined,
1211 the implementation might describe (in its user's manual)
1212 the algorithm it uses to determine the elaboration order.
1213 On the other hand, the implementation might provide a
1214 command that produces
1215 a description of the elaboration order for a partition upon request
1216 from the user.
1217 It is also acceptable to provide cross references to existing
1218 documentation (for example, a hardware manual), where appropriate.
1219
1220 Note that dependence of a program on implementation-defined or
1221 unspecified functionality is not defined to be an error;
1222 it might cause the program to be less portable, however.
1223 @end(Discussion)
1224 @ChgDocReq{Version=[2],Kind=[AddedNormal],Text=[@ChgAdded{Version=[2],Text=[
1225 The behavior of implementations in implementation-defined situations
1226 shall be documented @em see @RefSec{Implementation-Defined Characteristics}
1227 for a listing.]}]}
1228 @end{DocReq}
1229
1230 @begin{ImplAdvice}
1231 @Defn2{Term=[Program_Error],Sec=(raised by failure of run-time check)}
1232 If an implementation detects the use of an unsupported
1233 Specialized Needs Annex feature at run time,
1234 it should raise Program_Error if feasible.
1235 @ChgImplAdvice{Version=[2],Kind=[Added],Text=[@ChgAdded{Version=[2],
1236 Text=[Program_Error should be raised when an unsupported
1237 Specialized Needs Annex feature is used at run time.]}]}
1238 @begin{Reason}
1239 The reason we don't @i{require} Program_Error is that there are
1240 situations where other exceptions might make sense.
1241 For example, if the Real Time Systems Annex requires
1242 that the range of System.Priority include at least 30 values,
1243 an implementation could conform to the Standard
1244 (but not to the Annex)
1245 if it supported only 12 values.
1246 Since the rules of the language require Constraint_Error to be raised
1247 for out-of-range values,
1248 we cannot require Program_Error to be raised instead.
1249 @end{Reason}
1250
1251 If an implementation wishes to provide implementation-defined
1252 extensions to the functionality of a language-defined library unit,
1253 it should normally do so by adding children to the library unit.
1254 @ChgImplAdvice{Version=[2],Kind=[Added],Text=[@ChgAdded{Version=[2],
1255 Text=[Implementation-defined extensions to the functionality of a
1256 language-defined library unit should be provided by adding children
1257 to the library unit.]}]}
1258 @begin(ImplNote)
1259 If an implementation has support code
1260 (@lquotes@;run-time system code@rquotes@;)
1261 that is needed for the execution of user-defined code,
1262 it can put that support code in child packages of System.
1263 Otherwise, it has to use some trick to avoid polluting the user's
1264 namespace.
1265 It is important that such tricks not be available
1266 to user-defined code
1267 (not in the standard mode, at least)
1268 @em that would defeat the purpose.
1269 @end(ImplNote)
1270 @end{ImplAdvice}
1271
1272 @begin{Notes}
1273 The above requirements imply that an implementation conforming
1274 to this Standard may support some of the capabilities required by a
1275 Specialized Needs Annex without supporting all required
1276 capabilities.
1277 @begin{Discussion}
1278 A conforming implementation can partially support a
1279 Specialized Needs Annex.
1280 Such an implementation does not conform to the Annex,
1281 but it does conform to the Standard.
1282 @end{Discussion}
1283 @end{Notes}
1284
1285 @LabeledSubClause{Method of Description and Syntax Notation}
1286
1287 @begin{Intro}
1288 The form of an Ada program is described by means of a context-free
1289 syntax together with context-dependent requirements expressed by
1290 narrative rules.
1291
1292 The meaning of Ada programs is described by means of narrative
1293 rules defining both the effects of each construct and the composition
1294 rules for constructs.
1295
1296 @Leading@keepnext@;@Defn2{Term=[syntax], Sec=(notation)}
1297 @Defn2{Term=[grammar], Sec=(notation)}
1298 @Defn2{Term=[context free grammar], Sec=(notation)}
1299 @Defn2{Term=[BNF (Backus-Naur Form)], Sec=(notation)}
1300 @Defn2{Term=[Backus-Naur Form (BNF)], Sec=(notation)}
1301 The context-free syntax of the language is described using a simple variant
1302 of Backus-Naur Form. In particular:
1303 @begin(Itemize)
1304 @leading@keepnext@;Lower case words in a sans-serif font,
1305 some containing embedded underlines, are used to
1306 denote syntactic categories, for example:
1307 @begin(Display)
1308 @nt<case_statement>
1309 @end(Display)
1310
1311 @leading@keepnext@;Boldface words are used to denote reserved words, for example:
1312 @begin(Display)
1313 @key(array)
1314 @end(Display)
1315
1316 @leading@keepnext@;Square brackets enclose optional items. Thus the two following
1317 rules are equivalent.
1318 @begin(Display)
1319 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00433-01]}@Chg{Version=[2],New=[@nt<simple_return_statement>],Old=[@nt<return_statement>]} ::= @key(return) [@nt<expression>];
1320 @Chg{Version=[2],New=[@nt<simple_return_statement>],Old=[@nt<return_statement>]} ::= @key(return); | @key(return) @nt<expression>;
1321 @end(Display)
1322
1323 @leading@keepnext@;Curly brackets enclose a repeated item. The item may appear zero
1324 or more times; the repetitions occur from left to right as with an
1325 equivalent left-recursive rule. Thus the two following rules are
1326 equivalent.
1327 @begin(Display)
1328 @nt<term> ::= @nt<factor> {@nt<multiplying_operator> @nt<factor>}
1329 @nt<term> ::= @nt<factor> | @nt<term> @nt<multiplying_operator> @nt<factor>
1330 @end(Display)
1331
1332 @leading@keepnext@;A vertical line separates alternative items unless it occurs
1333 immediately after an opening curly bracket, in which case it stands
1334 for itself:
1335 @begin(Display)
1336 @nt<constraint> ::= @nt<scalar_constraint> | @nt<composite_constraint>
1337 @nt<discrete_choice_list> ::= @nt<discrete_choice> {| @nt<discrete_choice>}
1338 @end(Display)
1339
1340 @Defn2{Term=[italics],Sec=(syntax rules)}
1341 If the name of any syntactic category starts with an italicized
1342 part, it is equivalent to the category name without the italicized
1343 part. The italicized part is intended to convey some semantic
1344 information. For example @i(subtype_)@nt<name> and
1345 @i(task_)@nt<name> are both equivalent to @nt<name> alone.
1346 @end(Itemize)
1347 @begin(Discussion)
1348 @Defn{LR(1)}
1349 @Defn{ambiguous grammar}
1350 @Defn2{Term=[grammar],Sec=(resolution of ambiguity)}
1351 @Defn2{Term=[grammar],Sec=(ambiguous)}
1352 The grammar given in @Chg{Version=[2],New=[this International Standard],
1353 old=[the RM95]} is not LR(1).
1354 In fact, it is ambiguous; the ambiguities are resolved
1355 by the overload resolution rules
1356 (see @RefSecNum{The Context of Overload Resolution}).
1357
1358 We often use @lquotes@;if@rquotes@; to mean @lquotes@;if and only if@rquotes@; in definitions.
1359 For example, if we define @lquotes@;photogenic@rquotes@; by saying,
1360 @lquotes@;A type is photogenic if it has the following properties...,@rquotes@;
1361 we mean that a type is photogenic if @i{and only if}
1362 it has those properties.
1363 It is usually clear from the context,
1364 and adding the @lquotes@;and only if@rquotes@; seems too cumbersome.
1365
1366 When we say, for example, @lquotes@;a @nt{declarative_item} of a
1367 @nt{declarative_part}@rquotes@;, we are talking about a @nt{declarative_item}
1368 immediately within that @nt{declarative_part}. When we say @lquotes@;a
1369 @nt{declarative_item} in, or within, a @nt{declarative_part}@rquotes@;, we are
1370 talking about a @nt{declarative_item} anywhere in the
1371 @nt{declarative_part}, possibly deeply nested within other
1372 @nt{declarative_part}s. (This notation doesn't work very well for
1373 @nt{name}s, since the name @lquotes@;of@rquotes@; something also has another meaning.)
1374
1375 When we refer to the name of a language-defined
1376 entity (for example, Duration),
1377 we mean the language-defined entity even in programs where the declaration
1378 of the language-defined entity is hidden by another declaration.
1379 For example, when we say that the expected type for the @nt<expression>
1380 of a @nt<delay_relative_statement> is Duration, we mean the language-defined
1381 type Duration that is declared in Standard, not some type
1382 Duration the user might have declared.
1383 @end(Discussion)
1384
1385 @begin{Wide}
1386 @ChgRef{Version=[2],Kind=[Added],ARef=[AI95-00285-01]}
1387 @ChgAdded{Version=[2],Text=[The delimiters, compound delimiters, reserved words, and
1388 @nt{numeric_literal}s are exclusively made of the
1389 characters whose code position is between 16#20# and 16#7E#, inclusively.
1390 The special characters for which names are defined in this
1391 International Standard (see @RefSecNum{Character Set}) belong to the same range.
1392 @Redundant[For example, the character E in the definition of exponent is the
1393 character whose name is @lquotes@;LATIN CAPITAL LETTER E@rquotes@;, not
1394 @lquotes@;GREEK CAPITAL LETTER EPSILON@rquotes@;.]]}
1395 @begin{Discussion}
1396 @ChgRef{Version=[2],Kind=[AddedNormal]}
1397 @ChgAdded{Version=[2],Text=[This just means that programs can be written in plain
1398 ASCII characters; no characters outside of the 7-bit range are required.]}
1399 @end{Discussion}
1400
1401 @ChgRef{Version=[2],Kind=[Added],ARef=[AI95-00395-01]}
1402 @ChgAdded{Version=[2],Text=[When this International Standard mentions the
1403 conversion of some character or sequence of characters to upper case, it means
1404 the character or sequence of characters obtained by using locale-independent
1405 full case folding, as defined by documents referenced in the note in section 1
1406 of ISO/IEC 10646:2003.]}
1407 @begin{Discussion}
1408 @ChgRef{Version=[2],Kind=[AddedNormal]}
1409 @ChgAdded{Version=[2],Text=[Unless otherwise specified for sequences of
1410 characters, case folding is applied to the sequence, not to individual
1411 characters. It sometimes can make a difference.]}
1412 @end{Discussion}
1413 @end{Wide}
1414
1415 @begin{Wide}
1416 @Defn{syntactic category}
1417 A @i{syntactic category} is
1418 a nonterminal in the grammar defined in BNF under @lquotes@;@SyntaxTitle.@rquotes@;
1419 Names of syntactic categories are set in a different font,
1420 @ntf{like_this}.
1421 @end{Wide}
1422
1423 @ToGlossaryAlso{Term=<Construct>,
1424 Text=<A @i(construct) is a piece of text
1425 (explicit or implicit) that is an instance of a syntactic category
1426 defined under @lquotes@;@SyntaxTitle@rquotes@;.>}
1427 @begin{Ramification}
1428 For example, an @nt{expression} is a construct.
1429 A declaration is a construct,
1430 whereas the thing declared by a declaration is an @lquotes@;entity.@rquotes@;
1431 @end{Ramification}
1432 @begin{Discussion}
1433 @lquotes@;Explicit@rquotes@; and @lquotes@;implicit@rquotes@; don't mean exactly what you might think
1434 they mean: The text of an instance of a generic is
1435 considered explicit, even though it does not appear explicitly (in
1436 the non-technical sense) in the program text,
1437 and even though its meaning is not defined entirely in terms of that
1438 text.
1439 @end{Discussion}
1440
1441 @Defn2{term=<constituent>, Sec=<of a construct>}
1442 A @i{constituent} of a construct is the construct itself,
1443 or any construct appearing within it.
1444
1445 @Defn{arbitrary order}
1446 Whenever the run-time semantics
1447 defines certain actions to happen in an @i{arbitrary order},
1448 this means that the implementation shall arrange for these actions
1449 to occur in a way that is equivalent to some sequential order,
1450 following the rules that result from that sequential order.
1451 When evaluations are defined to happen in an arbitrary order,
1452 with conversion of the results to some subtypes,
1453 or with some run-time checks,
1454 the evaluations, conversions, and checks may be arbitrarily
1455 interspersed, so long as each expression is evaluated before converting
1456 or checking its value.
1457 @PDefn2{Term=[type conversion],Sec=(arbitrary order)}
1458 @PDefn2{Term=[conversion],Sec=(arbitrary order)}
1459 @Redundant[Note that the effect of a program can depend on the
1460 order chosen by the implementation.
1461 This can happen, for example,
1462 if two actual parameters of a given call have side effects.]
1463 @begin{Discussion}
1464 Programs will be more portable if their external effect does not
1465 depend on the particular order chosen by an implementation.
1466 @end{Discussion}
1467 @begin{Ramification}
1468 Additional reordering permissions are given in
1469 @RefSec(Exceptions and Optimization).
1470
1471 There is no requirement that the implementation always choose
1472 the same order in a given kind of situation. In fact, the
1473 implementation is allowed to choose a different order for two
1474 different executions of the same construct.
1475 However, we expect most implementations will behave in a relatively
1476 predictable manner in most situations.
1477 @end{Ramification}
1478 @begin{Reason}
1479 The @lquotes@;sequential order@rquotes@; wording is intended to allow the programmer
1480 to rely on @lquotes@;benign@rquotes@; side effects.
1481 For example, if F is a function that returns a unique integer by
1482 incrementing some global and returning the result,
1483 a call such as P(F, F) is OK if the programmer cares only
1484 that the two results of F are unique;
1485 the two calls of F cannot be executed in parallel,
1486 unless the compiler can prove that parallel execution is
1487 equivalent to some sequential order.
1488 @end{Reason}
1489 @end{Intro}
1490
1491 @begin{Notes}
1492 The syntax rules describing structured constructs are presented in a
1493 form that corresponds to the recommended paragraphing. For example, an
1494 @nt{if_statement} is defined as:
1495 @begin(Example)
1496 @nt<if_statement> ::=
1497 @key(if) @nt<condition> @key(then)
1498 @nt<sequence_of_statements>
1499 {@key(elsif) @nt<condition> @key(then)
1500 @nt<sequence_of_statements>}
1501 [@key(else)
1502 @nt<sequence_of_statements>]
1503 @key(end if);
1504 @end(Example)
1505
1506 The line breaks and indentation in the syntax rules indicate the
1507 recommended line breaks and indentation in the corresponding constructs.
1508 The preferred places for other line breaks are after semicolons.
1509 @end{Notes}
1510
1511 @begin{DiffWord95}
1512 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00285-01]}
1513 @ChgAdded{Version=[2],Text=[We now explicitly say that the lexical elements
1514 of the language (with a few exceptions) are made up of characters in the
1515 lower half of the Latin-1 character set. This is needed to avoid confusion
1516 given the new capability to use most ISO 10646 characters in identifiers and
1517 strings.]}
1518
1519 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00395-01]}
1520 @ChgAdded{Version=[2],Text=[We now explicitly define what the Standard means
1521 by upper case, as there are many possibilities for ISO 10646 characters.]}
1522
1523 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00433-01]}
1524 @ChgAdded{Version=[2],Text=[The example for square brackets has been changed
1525 as there is no longer a @ntf{return_statement} syntax rule.]}
1526 @end{DiffWord95}
1527
1528
1529 @LabeledSubClause{Classification of Errors}
1530
1531 @begin{ImplReq}
1532 @Leading@Keepnext@;The language definition classifies errors into several
1533 different categories:
1534 @begin(Itemize)
1535 @Keepnext@;Errors that are required to be detected prior to run time by every
1536 Ada implementation;
1537
1538 @NoPrefix@;These errors correspond to any violation of a rule given in this
1539 International Standard, other than those listed below.
1540 In particular, violation of any rule that uses the
1541 terms shall, allowed, permitted, legal, or illegal belongs to this
1542 category. Any program that contains such an error is not a legal
1543 Ada program; on the other hand, the fact that a program is legal
1544 does not mean, @i(per se), that the program is free from other
1545 forms of error.
1546
1547 @NoPrefix@Defn{compile-time error}
1548 @Defn2{Term=[error], Sec=(compile-time)}
1549 @IndexSee{Term=[link-time error],See=(post-compilation error)}
1550 @Defn2{Term=[error], Sec=(link-time)}
1551 The rules are further classified as either compile time rules, or
1552 post compilation rules, depending on whether a violation has to be
1553 detected at the time a compilation unit is submitted to
1554 the compiler,
1555 or may be postponed until the time a compilation unit is
1556 incorporated into a partition of a program.
1557 @begin{Ramification}
1558 See, for example, @RefSec(Subunits of Compilation Units),
1559 for some errors that are detected only after compilation.
1560 Implementations are allowed, but not required, to detect post
1561 compilation rules at compile time when possible.
1562 @end{Ramification}
1563
1564 @Keepnext@;Errors that are required to be detected at run time by the
1565 execution of an Ada program;
1566
1567 @NoPrefix@Defn{run-time error}
1568 @Defn2{Term=[error], Sec=(run-time)}
1569 The corresponding error situations are associated with the names of
1570 the predefined exceptions. Every Ada compiler is required to
1571 generate code that raises the corresponding exception if such an
1572 error situation arises during program execution.
1573 @Redundant[If such an error situation is certain to arise in every
1574 execution of a construct, then an implementation is allowed
1575 (although not required) to report this fact at compilation time.]
1576
1577
1578 @Keepnext@;Bounded errors;
1579
1580 @NoPrefix@;The language rules define certain kinds of errors that need not be
1581 detected either prior to or during run time, but if not detected,
1582 the range of possible effects shall be bounded.
1583 @Defn{bounded error}
1584 The errors of this category are called @i{bounded errors}.
1585 @Defn2{Term=[Program_Error],Sec=(raised by failure of run-time check)}
1586 The possible effects of a given bounded error are specified for
1587 each such error, but in any case one possible effect of a bounded
1588 error is the raising of the exception Program_Error.
1589
1590 @Keepnext@;Erroneous execution.
1591
1592 @NoPrefix@Defn{erroneous execution}
1593 In addition to bounded errors, the language rules define certain
1594 kinds of errors as leading to @i{erroneous execution}. Like bounded
1595 errors, the implementation need not detect such errors either prior
1596 to or during run time. Unlike bounded errors, there is no
1597 language-specified bound on the possible effect of erroneous
1598 execution; the effect is in general not predictable.
1599 @begin{Ramification}
1600 Executions are erroneous, not programs or parts of programs.
1601 Once something erroneous happens, the execution of the entire program
1602 is erroneous from that point on, and potentially before given
1603 possible reorderings permitted by
1604 @RefSecNum(Exceptions and Optimization) and elsewhere.
1605 We cannot limit it to just one partition,
1606 since partitions are not required to live in separate address spaces.
1607 (But implementations are encouraged to limit it as much as possible.)
1608
1609 Suppose a program contains a pair of things that will be executed @lquotes@;in
1610 an arbitrary order.@rquotes@;
1611 It is possible that one order will result in something sensible, whereas
1612 the other order will result in erroneous execution.
1613 If the implementation happens to choose the first order,
1614 then the execution is not erroneous.
1615 This may seem odd, but it is not harmful.
1616
1617 Saying that something is erroneous is semantically
1618 equivalent to saying that the behavior is unspecified.
1619 However, @lquotes@;erroneous@rquotes@; has a slightly more disapproving
1620 flavor.
1621 @end{Ramification}
1622
1623 @end(Itemize)
1624 @end{ImplReq}
1625
1626 @begin{ImplPerm}
1627 @Redundant[@Defn2{Term={mode of operation}, Sec=(nonstandard)}
1628 @Defn{nonstandard mode}An implementation may provide
1629 @i(nonstandard modes) of operation.
1630 Typically these modes would be selected by a @nt<pragma> or by a command line
1631 switch when the compiler is invoked. When operating in
1632 a nonstandard mode, the implementation may reject @nt<compilation_unit>s
1633 that do not conform to additional requirements associated
1634 with the mode, such as an excessive number of warnings or violation
1635 of coding style guidelines. Similarly, in a nonstandard mode,
1636 the implementation may apply special optimizations or alternative
1637 algorithms that are only meaningful for programs that
1638 satisfy certain criteria specified by the implementation.
1639 @Defn2{Term={mode of operation}, Sec=(standard)}
1640 @Defn{standard mode}
1641 In any case, an implementation shall support a @i(standard) mode that
1642 conforms to the requirements of this International Standard; in particular, in the standard
1643 mode, all legal @nt<compilation_unit>s shall be accepted.]
1644 @begin{Discussion}
1645 These permissions are designed to authorize explicitly the
1646 support for alternative modes. Of course, nothing we say can
1647 prevent them anyway, but this (redundant) paragraph is designed
1648 to indicate that such alternative modes are in some sense @lquotes@;approved@rquotes@;
1649 and even encouraged where they serve the specialized needs of
1650 a given user community, so long as the standard mode, designed
1651 to foster maximum portability, is always available.
1652 @end{Discussion}
1653 @end{ImplPerm}
1654
1655 @begin{ImplAdvice}
1656 @Defn2{Term=[Program_Error],Sec=(raised by failure of run-time check)}
1657 If an implementation detects a bounded error or erroneous execution,
1658 it should raise Program_Error.
1659 @ChgImplAdvice{Version=[2],Kind=[Added],Text=[@ChgAdded{Version=[2],
1660 Text=[If a bounded error or erroneous execution is detected, Program_Error
1661 should be raised.]}]}
1662 @end{ImplAdvice}
1663
1664 @begin{DiffWord83}
1665 Some situations that are erroneous in Ada 83 are no longer errors
1666 at all.
1667 For example, depending on the parameter passing mechanism when
1668 unspecified is possibly non-portable, but not erroneous.
1669
1670 Other situations that are erroneous in Ada 83 are changed
1671 to be bounded errors.
1672 In particular, evaluating an uninitialized scalar variable is
1673 a bounded error.
1674 @Defn2{Term=[Program_Error],Sec=(raised by failure of run-time check)}
1675 The possible results are to raise Program_Error (as always), or to
1676 produce a machine-representable value (which might not be in the
1677 subtype of the variable).
1678 @Defn2{Term=[Constraint_Error],Sec=(raised by failure of run-time check)}
1679 Violating a Range_Check or Overflow_Check raises
1680 Constraint_Error, even if the value came from an uninitialized
1681 variable.
1682 This means that optimizers can no longer
1683 @lquotes@;assume@rquotes@; that all variables are initialized within their subtype's
1684 range.
1685 Violating a check that is suppressed remains erroneous.
1686
1687 The @lquotes@;incorrect order dependences@rquotes@; category of errors is removed.
1688 All such situations are simply considered potential non-portabilities.
1689 This category was removed due to the difficulty of defining
1690 what it means for two executions to have a @lquotes@;different effect.@rquotes@;
1691 For example, if a function with a side-effect is called twice in a single
1692 expression, it is not in principle possible for the compiler to
1693 decide whether the correctness of the resulting program depends on the order
1694 of execution of the two function calls. A compile time warning
1695 might be appropriate, but raising of Program_Error at
1696 run time would not be.
1697 @end{DiffWord83}
1698
1699 @LabeledClause{Normative References}
1700
1701 @begin{Intro}
1702 @Defn{references}
1703 @Defn{bibliography}
1704 The following standards contain provisions which, through reference in
1705 this text, constitute provisions of this International Standard. At the
1706 time of publication, the editions indicated were valid. All standards
1707 are subject to revision, and parties to agreements based on this
1708 International Standard are encouraged to investigate the possibility
1709 of applying the most recent editions of the standards indicated below.
1710 Members of IEC and ISO maintain registers of currently valid International
1711 Standards.
1712
1713
1714 @Defn{ISO/IEC 646:1991}
1715 @Defn{646:1991, ISO/IEC standard}
1716 @Defn2{Term=[character set standard],Sec=(7-bit)}
1717 ISO/IEC 646:1991,
1718 @i{Information technology @em ISO 7-bit coded character
1719 set for information interchange}.
1720
1721 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00415-01]}
1722 @Chg{Version=[2],New=[@Defn{ISO/IEC 1539-1:2004}
1723 @Defn{1539-1:2004, ISO/IEC standard}
1724 @Defn{Fortran standard}],
1725 Old=[@Defn{ISO/IEC 1539:1991}
1726 @Defn{1539:1991, ISO/IEC standard}
1727 @Defn{FORTRAN standard}]}
1728 ISO/IEC @Chg{Version=[2],New=[1539-1:2004],Old=[1539:1991]},
1729 @i{Information technology @em Programming languages @em @Chg{Version=[2],
1730 New=[Fortran @em Part 1: Base language],Old=[FORTRAN]}}.
1731
1732 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00415-01]}
1733 @Chg{Version=[2],New=[@Defn{ISO 1989:2002}
1734 @Defn{1989:2002, ISO standard}],Old=[@Defn{ISO 1989:1985}
1735 @Defn{1989:1985, ISO standard}]}
1736 @Defn{COBOL standard}
1737 ISO@Chg{Version=[2],New=[/IEC],Old=[]} 1989:@Chg{Version=[2],New=[2002],Old=[1985]},
1738 @i{@Chg{Version=[2],New=[Information technology @em ],Old=[]}Programming languages @em COBOL}.
1739
1740 @Defn{ISO/IEC 6429:1992}
1741 @Defn{6429:1992, ISO/IEC standard}
1742 @Defn2{Term=[character set standard],Sec=(control functions)}
1743 ISO/IEC 6429:1992,
1744 @i{Information technology @em Control functions for coded
1745 graphic character sets}.
1746
1747 @ChgRef{Version=[2],Kind=[Added],ARef=[AI95-00351-01]}
1748 @ChgAdded{Version=[2],Text=[@Defn{ISO 8601:2004}
1749 @Defn{date and time formatting standard}
1750 ISO 8601:2004, @i{Data elements and interchange formats @em Information
1751 interchange @em Representation of dates and times}.]}
1752
1753 @Defn{ISO/IEC 8859-1:1987}
1754 @Defn{8859-1:1987, ISO/IEC standard}
1755 @Defn2{Term=[character set standard],Sec=(8-bit)}
1756 ISO/IEC 8859-1:1987,
1757 @i{Information processing @em 8-bit single-byte coded
1758 character sets @em Part 1: Latin alphabet No. 1}.
1759
1760 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00415-01]}
1761 @Chg{Version=[2],New=[@Defn{ISO/IEC 9899:1999}
1762 @Defn{9899:1999, ISO/IEC standard}],
1763 Old=[@Defn{ISO/IEC 9899:1990}
1764 @Defn{9899:1990, ISO/IEC standard}]}
1765 @Defn{C standard}
1766 ISO/IEC 9899:@Chg{Version=[2],New=[1999],Old=[1990]},
1767 @i{Programming
1768 languages @em C}@Chg{Version=[2],New=[, supplemented by Technical
1769 Corrigendum 1:2001 and Technical Corrigendum 2:2004],Old=[]}.
1770 @begin{Discussion}
1771 @ChgRef{Version=[2],Kind=[AddedNormal]}
1772 @ChgAdded{Version=[2],Text=[Unlike Fortran and COBOL, which added the
1773 @i{Information technology} prefix to the titles of their standard, C did
1774 not. This was confirmed in the list of standards titles on the ISO web site.
1775 No idea why ISO allowed that@Comment{, or whether C is planning to secede
1776 from SC22}.]}
1777 @end{Discussion}
1778
1779 @ChgRef{Version=[1],Kind=[Revised],Ref=[8652/0001],ARef=[AI95-00124-01]}
1780 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00285-01]}
1781 @Chg{Version=[2],New=[@Defn{ISO/IEC 10646:2003}
1782 @Defn{10646:2003, ISO/IEC standard}
1783 @Defn2{Term=[character set standard],Sec=(16 and 32-bit)}
1784 ISO/IEC 10646:2003, @i{Information technology @em Universal Multiple-Octet
1785 Coded Character Set (UCS)}.],
1786 Old=[@Defn{ISO/IEC 10646-1:1993}
1787 @Defn{10646-1:1993, ISO/IEC standard}
1788 @Defn2{Term=[character set standard],Sec=(16-bit)}
1789 ISO/IEC 10646-1:1993,
1790 @i{Information technology @em Universal Multiple-Octet
1791 Coded Character Set (UCS) @em Part 1: Architecture and Basic
1792 Multilingual Plane}@Chg{Version=[1],New=[, supplemented by Technical Corrigendum
1793 1:1996], Old=[]}.]}
1794
1795 @begin{Reason}
1796 @ChgRef{Version=[1],Kind=[Added],Ref=[8652/0001],ARef=[AI95-00124-01]}
1797 @ChgRef{Version=[2],Kind=[DeletedAdded],ARef=[AI95-00285-01]}
1798 @ChgNote{This is of only historical interest, so it was deleted; we use the
1799 Unicode characterization now.}
1800 @ChgDeleted{Version=[2],Text=[
1801 @Chg{Version=[1],New=[The Technical Corrigendum 1:1996 is needed so that character
1802 codes C6 and E6 (the ligatures @latin1(198) and @latin1(230)) are considered
1803 letters. These were named Latin Ligature AE in the original 1993 version,
1804 which would exclude them from being letters as defined in
1805 @RefSec{Character Set}.], Old=[]}]}
1806 @end{Reason}
1807
1808 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00376-01]}
1809 @ChgAdded{Version=[2],Text=[@Defn{ISO/IEC 14882:2003}
1810 @Defn{14882:2003, ISO/IEC standard}
1811 @Defn{C++ standard}
1812 ISO/IEC 14882:2003, @i{Programming languages @em C++}.]}
1813 @begin{Discussion}
1814 @ChgRef{Version=[2],Kind=[AddedNormal]}
1815 @ChgAdded{Version=[2],Text=[This title is also missing the
1816 @i{Information technology} part. That was confirmed in the list of standards
1817 titles on the ISO web site.]}
1818 @end{Discussion}
1819
1820 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00285-01]}
1821 @ChgAdded{Version=[2],Text=[@Defn{ISO/IEC TR 19769:2004}
1822 @Defn{19769:2004, ISO/IEC technical report}
1823 ISO/IEC TR 19769:2004, @i{Information technology @em Programming languages,
1824 their environments and system software interfaces @em Extensions for the
1825 programming language C to support new character data types}.]}
1826
1827 @begin{Discussion}
1828 @Defn{POSIX}
1829 POSIX,
1830 @i{Portable Operating System Interface (POSIX)
1831 @em Part 1: System Application Program Interface (API) [C Language]},
1832 The Institute of Electrical and Electronics Engineers,
1833 1990.
1834 @end{Discussion}
1835 @end{Intro}
1836
1837 @begin{DiffWord95}
1838 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00285-01],ARef=[AI95-00376-01],ARef=[AI95-00415-01]}
1839 @ChgAdded{Version=[2],Text=[Updated references to the most recent versions
1840 of these standards. Added C++ and time standards. Added C character set technical
1841 report.]}
1842 @end{DiffWord95}
1843
1844
1845
1846 @LabeledClause{Definitions}
1847
1848 @begin{Intro}
1849 @ChgRef{Version=[2],Kind=[Revised],ARef=[AI95-00415-01]}
1850 @Defn2{Term=[italics],Sec=(terms introduced or defined)}
1851 Terms are defined throughout this International Standard,
1852 indicated by @i(italic) type.
1853 Terms explicitly defined in this International Standard are not to be presumed to
1854 refer implicitly to similar terms defined elsewhere.
1855 @Chg{Version=[2],New=[Mathematical terms not defined in this International
1856 Standard are to be interpreted according to the @i<CRC Concise Encyclopedia of
1857 Mathematics, Second Edition>. Other terms],Old=[Terms]} not defined in this
1858 International Standard are to be interpreted according to
1859 the @i(Webster's Third New International Dictionary of the
1860 English Language).
1861 Informal descriptions of some terms are also given in
1862 @RefSec{Glossary}.
1863 @Comment{These are here to avoid a blank paragraph at the end, and because
1864 they have to be somewhere.}
1865 @SeeAlso{Primary=[library unit], Other=(language-defined library units)}
1866 @SeeOther{Primary=[predefined library unit], Other=(language-defined library units)}
1867 @SeeAlso{Primary=[type], Other=(language-defined types)}
1868 @SeeOther{Primary=[predefined type], Other=(language-defined types)}
1869 @begin{Discussion}
1870 The index contains an entry for every defined term.
1871
1872 @ChgRef{Version=[2],Kind=[Added],ARef=[AI95-00415-01]}
1873 @ChgAdded{Version=[2],Text=[The contents of the @i<CRC Concise Encyclopedia of
1874 Mathematics, Second Edition> can be accessed on
1875 @URLLink{URL=[http://www.mathworld.com],Text=[http://www.mathworld.com]}.
1876 The ISBN number of the book is ISBN 1584883472.]}
1877 @end{Discussion}
1878 @begin{GlossaryMarker}
1879 Each term defined in @RefSecNum{Glossary}
1880 is marked like this.
1881 @end{GlossaryMarker}
1882 @end{Intro}
1883
1884 @begin{Discussion}
1885 @ChgRef{Version=[1],Kind=[Revised]}
1886 @ChgRef{Version=[2],Kind=[Revised]}
1887 Here are some AARM-only definitions:
1888 @Defn{Ada Rapporteur Group (ARG)}
1889 @Defn(ARG)
1890 The Ada Rapporteur Group (ARG) interprets the @Chg{Version=[1],New=<Ada Reference Manual>,Old=<RM83>}.
1891 @Defn{Ada Issue (AI)}
1892 @Defn(AI)
1893 An Ada Issue (AI) is a numbered ruling from the ARG.@Chg{Version=[1],New=< Ada Issues
1894 created for Ada 83 are denoted as "AI83", while Ada Issues created for Ada 95
1895 are denoted as "AI95" in this document.>,Old=<>}
1896 @Defn{Ada Commentary Integration Document (ACID)}
1897 @Defn(ACID)
1898 The Ada Commentary Integration Document (ACID)
1899 is an edition of @Chg{Version=[2],New=[the Ada 83 RM],Old=[RM83]}
1900 in which clearly marked insertions
1901 and deletions indicate the effect of integrating the approved AIs.
1902 @Defn{Uniformity Rapporteur Group (URG)}
1903 @Defn(URG)
1904 The Uniformity Rapporteur Group (URG) @Chg{Version=[1],New=<issued>,Old=<issues>}
1905 recommendations intended to increase uniformity across Ada implementations.
1906 @Chg{Version=[1],New=<The functions of the URG have been assumed by the ARG.>,Old=<>}
1907 @Defn{Uniformity Issue (UI)}
1908 @Defn(UI)
1909 A Uniformity Issue (UI) @Chg{Version=[1],New=<was>,Old=<is>} a numbered recommendation from the URG.
1910 @Chg{Version=[1],New=<A Defect Report and Response is an official query to WG9 about an
1911 error in the standard. Defect Reports are processed by the ARG, and are
1912 referenced here by their ISO numbers: 8652/nnnn. Most changes to the Ada 95
1913 standard include reference(s) to the Defect Report(s) that prompted the change.>,Old=<>}
1914 @Chg{Version=[1],New=[@PDefn2{Term=[ACVC],Sec=(Ada Compiler Validation Capability)}
1915 @PDefn2{Term=[Ada Compiler Validation Capability],Sec=(ACVC)}
1916 @PDefn2{Term=[ACATS],Sec=(Ada Conformity Assessment Test Suite)}
1917 @PDefn2{Term=[Ada Conformity Assessment Test Suite],Sec=(ACATS)}
1918 The @i<Ada Conformity Assessment Test Suite (ACATS)> is a set of tests intended
1919 to check the conformity of Ada implementations to this standard. This set of
1920 tests was previously known as the Ada Compiler Validation Capability (ACVC).],Old=[]}
1921 @end{Discussion}