|
267 | 267 |
|
268 | 268 | \indexdefn{behavior!undefined}%
|
269 | 269 | \definition{undefined behavior}{defns.undefined}
|
270 |
| -behavior for which this International Standard |
| 270 | +behavior for which this document |
271 | 271 | imposes no requirements
|
272 | 272 |
|
273 | 273 | \begin{defnote}
|
274 | 274 | Undefined behavior may be expected when
|
275 |
| -this International Standard omits any explicit |
| 275 | +this document omits any explicit |
276 | 276 | definition of behavior or when a program uses an erroneous construct or erroneous data.
|
277 | 277 | Permissible undefined behavior ranges
|
278 | 278 | from ignoring the situation completely with unpredictable results, to
|
|
293 | 293 | \begin{defnote}
|
294 | 294 | The implementation is not required to
|
295 | 295 | document which behavior occurs. The range of
|
296 |
| -possible behaviors is usually delineated by this International Standard. |
| 296 | +possible behaviors is usually delineated by this document. |
297 | 297 | \end{defnote}
|
298 | 298 |
|
299 | 299 | \indexdefn{program!well-formed}%
|
|
333 | 333 | \indextext{conformance requirements!general|(}%
|
334 | 334 | The set of
|
335 | 335 | \defn{diagnosable rules}
|
336 |
| -consists of all syntactic and semantic rules in this International |
337 |
| -Standard except for those rules containing an explicit notation that |
| 336 | +consists of all syntactic and semantic rules in this document |
| 337 | +except for those rules containing an explicit notation that |
338 | 338 | ``no diagnostic is required'' or which are described as resulting in
|
339 | 339 | ``undefined behavior''.
|
340 | 340 |
|
341 | 341 | \pnum
|
342 | 342 | \indextext{conformance requirements!method of description}%
|
343 |
| -Although this International Standard states only requirements on \Cpp |
| 343 | +Although this document states only requirements on \Cpp |
344 | 344 | implementations, those requirements are often easier to understand if
|
345 | 345 | they are phrased as requirements on programs, parts of programs, or
|
346 | 346 | execution of programs. Such requirements have the following meaning:
|
347 | 347 | \begin{itemize}
|
348 | 348 | \item
|
349 | 349 | If a program contains no violations of the rules in this
|
350 |
| -International Standard, a conforming implementation shall, |
| 350 | +document, a conforming implementation shall, |
351 | 351 | within its resource limits, accept and correctly execute\footnote{``Correct execution'' can include undefined behavior, depending on
|
352 | 352 | the data being processed; see Clause~\ref{intro.defs} and~\ref{intro.execution}.}
|
353 | 353 | that program.
|
354 | 354 | \item
|
355 | 355 | \indextext{message!diagnostic}%
|
356 | 356 | If a program contains a violation of any diagnosable rule or an occurrence
|
357 |
| -of a construct described in this International Standard as ``conditionally-supported'' when |
| 357 | +of a construct described in this document as ``conditionally-supported'' when |
358 | 358 | the implementation does not support that construct, a conforming implementation
|
359 | 359 | shall issue at least one diagnostic message.
|
360 | 360 | \item
|
361 | 361 | \indextext{behavior!undefined}%
|
362 | 362 | If a program contains a violation of a rule for which no diagnostic
|
363 |
| -is required, this International Standard places no requirement on |
| 363 | +is required, this document places no requirement on |
364 | 364 | implementations with respect to that program.
|
365 | 365 | \end{itemize}
|
366 | 366 | \begin{note}
|
|
400 | 400 | \pnum
|
401 | 401 | Two kinds of implementations are defined: a \defn{hosted implementation} and a
|
402 | 402 | \defn{freestanding implementation}. For a hosted implementation, this
|
403 |
| -International Standard defines the set of available libraries. A freestanding |
| 403 | +document defines the set of available libraries. A freestanding |
404 | 404 | implementation is one in which execution may take place without the benefit of
|
405 | 405 | an operating system, and has an \impldef{required libraries for freestanding
|
406 | 406 | implementation} set of libraries that includes certain language-support
|
|
411 | 411 | additional library functions), provided they do not alter the
|
412 | 412 | behavior of any well-formed program.
|
413 | 413 | Implementations are required to diagnose programs that use such
|
414 |
| -extensions that are ill-formed according to this International Standard. |
| 414 | +extensions that are ill-formed according to this document. |
415 | 415 | Having done so, however, they can compile and execute such programs.
|
416 | 416 |
|
417 | 417 | \pnum
|
|
756 | 756 | \pnum
|
757 | 757 | \indextext{program execution|(}%
|
758 | 758 | \indextext{program execution!abstract machine}%
|
759 |
| -The semantic descriptions in this International Standard define a |
760 |
| -parameterized nondeterministic abstract machine. This International |
761 |
| -Standard places no requirement on the structure of conforming |
| 759 | +The semantic descriptions in this document define a |
| 760 | +parameterized nondeterministic abstract machine. This document |
| 761 | +places no requirement on the structure of conforming |
762 | 762 | implementations. In particular, they need not copy or emulate the
|
763 | 763 | structure of the abstract machine.
|
764 | 764 | \indextext{as-if rule}%
|
765 | 765 | \indextext{behavior!observable}%
|
766 | 766 | Rather, conforming implementations are required to emulate (only) the observable
|
767 | 767 | behavior of the abstract machine as explained below.\footnote{This provision is
|
768 | 768 | sometimes called the ``as-if'' rule, because an implementation is free to
|
769 |
| -disregard any requirement of this International Standard as long as the result |
| 769 | +disregard any requirement of this document as long as the result |
770 | 770 | is \emph{as if} the requirement had been obeyed, as far as can be determined
|
771 | 771 | from the observable behavior of the program. For instance, an actual
|
772 | 772 | implementation need not evaluate part of an expression if it can deduce that its
|
|
778 | 778 | \indextext{behavior!implementation-defined}%
|
779 | 779 | \pnum
|
780 | 780 | Certain aspects and operations of the abstract machine are described in this
|
781 |
| -International Standard as implementation-defined (for example, |
| 781 | +document as implementation-defined (for example, |
782 | 782 | \tcode{sizeof(int)}). These constitute the parameters of the abstract machine.
|
783 | 783 | Each implementation shall include documentation describing its characteristics
|
784 | 784 | and behavior in these respects.\footnote{This documentation also includes
|
|
790 | 790 | \indextext{behavior!unspecified}%
|
791 | 791 | \pnum
|
792 | 792 | Certain other aspects and operations of the abstract machine are
|
793 |
| -described in this International Standard as unspecified (for example, |
| 793 | +described in this document as unspecified (for example, |
794 | 794 | evaluation of expressions in a \grammarterm{new-initializer} if the allocation
|
795 | 795 | function fails to allocate memory~(\ref{expr.new})). Where possible, this
|
796 |
| -International Standard defines a set of allowable behaviors. These |
| 796 | +document defines a set of allowable behaviors. These |
797 | 797 | define the nondeterministic aspects of the abstract machine. An instance
|
798 | 798 | of the abstract machine can thus have more than one possible execution
|
799 | 799 | for a given program and a given input.
|
800 | 800 |
|
801 | 801 | \indextext{behavior!undefined}%
|
802 | 802 | \pnum
|
803 |
| -Certain other operations are described in this International Standard as |
| 803 | +Certain other operations are described in this document as |
804 | 804 | undefined (for example, the effect of
|
805 | 805 | attempting to modify a \tcode{const} object).
|
806 |
| -\begin{note} This International Standard imposes no requirements on the |
| 806 | +\begin{note} This document imposes no requirements on the |
807 | 807 | behavior of programs that contain undefined behavior. \end{note}
|
808 | 808 |
|
809 | 809 | \indextext{program!well-formed}%
|
|
814 | 814 | of the corresponding instance of the abstract machine with the
|
815 | 815 | same program and the same input.
|
816 | 816 | \indextext{behavior!undefined}%
|
817 |
| -However, if any such execution contains an undefined operation, this International Standard places no |
| 817 | +However, if any such execution contains an undefined operation, this document places no |
818 | 818 | requirement on the implementation executing that program with that input
|
819 | 819 | (not even with regard to operations preceding the first undefined
|
820 | 820 | operation).
|
|
1160 | 1160 | through a pointer or reference~(\ref{basic.compound}).} Under a hosted
|
1161 | 1161 | implementation, a \Cpp program can have more than one thread running
|
1162 | 1162 | concurrently. The execution of each thread proceeds as defined by the remainder
|
1163 |
| -of this International Standard. The execution of the entire program consists of an execution |
| 1163 | +of this document. The execution of the entire program consists of an execution |
1164 | 1164 | of all of its threads. \begin{note} Usually the execution can be viewed as an
|
1165 | 1165 | interleaving of all its threads. However, some kinds of atomic operations, for
|
1166 | 1166 | example, allow executions inconsistent with a simple interleaving, as described
|
|
1490 | 1490 | \pnum
|
1491 | 1491 | \begin{note} Compiler transformations that introduce assignments to a potentially
|
1492 | 1492 | shared memory location that would not be modified by the abstract machine are
|
1493 |
| -generally precluded by this International Standard, since such an assignment might overwrite |
| 1493 | +generally precluded by this document, since such an assignment might overwrite |
1494 | 1494 | another assignment by a different thread in cases in which an abstract machine
|
1495 | 1495 | execution would not have encountered a data race. This includes implementations
|
1496 | 1496 | of data member assignment that overwrite adjacent members in separate memory
|
|
1501 | 1501 | \pnum
|
1502 | 1502 | \begin{note} Transformations that introduce a speculative read of a potentially
|
1503 | 1503 | shared memory location may not preserve the semantics of the \Cpp program as
|
1504 |
| -defined in this International Standard, since they potentially introduce a data race. However, |
| 1504 | +defined in this document, since they potentially introduce a data race. However, |
1505 | 1505 | they are typically valid in the context of an optimizing compiler that targets a
|
1506 | 1506 | specific machine with well-defined semantics for data races. They would be
|
1507 | 1507 | invalid for a hypothetical machine that is not tolerant of races or provides
|
|
0 commit comments