Can we apply content not explicitly cited from the

2019-01-11 10:32发布

问题:

In the C++11 standard(closest draft is N3337) section 1.2 Normative references says:

The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

but there are no guidelines on how to apply the references. The easy cases are when the C++11 explicitly refers back to a reference, for example in section 3.9.1 Fundamental types it says:

[...]The signed and unsigned integer types shall satisfy the constraints given in the C standard, section 5.2.4.2.1.

But what about other cases where there is no explicit reference? For example, C++11 uses the word indeterminate value but it does not define the term. The normative references include:

— ISO/IEC 9899:1999, Programming languages — C

[...]

— ISO/IEC 9899:1999/Cor.3:2007(E), Programming languages — C, Technical Corrigendum 3

and C99(draft c99 standard) does have a definition for indeterminate value in section 3.17.2 which says:

either an unspecified value or a trap representation

Is it correct to say that indeterminate value is defined C++11 by reference to C99, like this answer seems to do for the definition of bit? If yes, what about trap representation which is covered in in section 6.2.6.1 paragraph 5 under Representations of types in C99?

The generous reading would be that as long as nothing in the C++11 conflicts with a normative reference then it applies, is this the correct interpretation? Some of the answers to What is indeterminate behavior in C++ ? How is it different from undefined behavior? seem to imply a generous reading, although the language is a bit loose in some of the answers, so it is hard to tell what exactly is being claimed on some points.

回答1:

The function of the Normative References section of an ISO standard document is defined in ISO/IEC Directives, Part 2, 2011 §6.2.2:

6.2.2 Normative references

This conditional element shall give a list of the referenced documents cited (see 6.6.7.5) in the document in such a way as to make them indispensable for the application of the document. For dated references, each shall be given with its year of publication, or, in the case of enquiry or final drafts, with a dash together with a footnote “To be published.”, and full title. The year of publication or dash shall not be given for undated references. When an undated reference is to all parts of a document, the publication number shall be followed by the indication “(all parts)” and the general title of the series of parts (i.e. the introductory and main elements, see Annex E).

In principle, the referenced documents shall be documents published by ISO and/or IEC. Documents published by other bodies may be referred to in a normative manner provided that

a) the referenced document is recognized by the ISO and/or IEC committee concerned as having wide acceptance and authoritative status as well as being publicly available,

b) the ISO and/or IEC committee concerned has obtained the agreement of the authors or publishers (where known) of the referenced document to its inclusion and to its being made available as required — the authors or publishers will be expected to make available such documents on request,

c) the authors or publishers (where known) have also agreed to inform the ISO and/or IEC committee concerned of their intention to revise the referenced document and of the points the revision will concern, and

d) the ISO and/or IEC committee concerned undertakes to review the situation in the light of any changes in the referenced document.

The list shall be introduced by the following wording:

“The following documents, in whole or in part, are normatively referenced in this document and are indispensable for its application. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.”

The above wording is also applicable to a part of a multipart document.

The list shall not include the following:

  • referenced documents which are not publicly available;

  • referenced documents which are only cited in an informative manner;

  • referenced documents which have merely served as bibliographic or background material in the preparation of the document.

Such referenced documents may be listed in a bibliography (see 6.4.2).

It notably does not say that the contents of the referenced documents are incorporated into the current document. Essentially it serves as a list of all the other standard documents that are in some way normatively referenced elsewhere in the document.

So not everything in, e.g., C99 is incorporated into C++11 - only those parts of C99 specifically referenced as being incorporated in the C++11 standard.