Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: Is this really necessary Date: Sun, 15 Aug 2021 07:02:20 -0700 Organization: A noiseless patient Spider Lines: 103 Message-ID: <86sfzax0ur.fsf@linuxsc.com> References: <8635rh1m2i.fsf@linuxsc.com> <86bl63zs5l.fsf@linuxsc.com> <86y297x7fz.fsf@linuxsc.com> <86tujuy93d.fsf@linuxsc.com> <874kbti4yp.fsf@nosuchdomain.example.com> <86a6lkxr7s.fsf@linuxsc.com> <87zgtjhizw.fsf@nosuchdomain.example.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="4dd8ce6a7e240a14eec73d2f816adcd2"; logging-data="23166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HXpDgU6E2nLl8S2uwxru1Lb89lXLMeL8=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:56dDQvFX16lNI+3kRBn5TxpT2qE= sha1:M12Zi69RfcuxA5lnSF+nNkXvfmI= Xref: csiph.com comp.lang.c++:80890 Keith Thompson writes: > Tim Rentsch writes: > >> Keith Thompson writes: > > [...] > >>> The wording in C++03 is a bit vague. >>> >>> 17.3.1.4 C Library [lib.structure.see.also] >>> >>> Paragraphs labelled "SEE ALSO:" contain cross-references to >>> the relevant portions of this Standard and the ISO C standard, >>> which is incorporated into this Standard by reference. >>> >>> That could be read to imply that the entire C standard is included >>> by reference, [...] >> >> There is no ambiguity in this sentence about what phrase is being >> referenced for incorporation, and that is the (entire) ISO C >> standard. If it were meant to incorporate only some portions of >> the ISO C standard, the sentence would have said "which _are_ >> incorporated" rather than "which _is_ incorporated". > > (For those not familiar with the C standard, section 6 defines the > core language and section 7 defines the library.) > > I agree that it *says* that the entire C standard is incorporated, > but I'm not convinced that was the intent. I admittedly let my > assumptions influence how I read it. I think the intent matches the most literal reading of the words: the C++ standard incorporates the C standard. That doesn't mean the C++ /language/ incorporates the C /language/, only that a C++ /document/ incorporates a C /document/. Incorporating the ISO C standard does not by itself affect the _semantics_ of C++; in areas where it is important for C++ to adopt the semantics of some part of C, that is done using an explicit reference to the incorporated C standard. > In the C++11 standard, the section is: > > 17.5.1.5 [structure.see.also] > > Paragraphs labeled ?See also:? contain cross-references to the > relevant portions of this International Standard and the ISO C > standard, which is incorporated into this International > Standard by reference. Yes, AFAICT the wording of this paragraph is the same from C++98 to C++14, except that C++11 and C++14 insert the word "International" between "this" and "Standard". > In C++17 (in the draft I have), it changed to: > > 20.4.1.5 [structure.see.also] > > Paragraphs labeled ?See also:? contain cross-references to > the relevant portions of the ISO C standard. In N4659, dated 2017-03-21, 20.4.1.5 p1 says this: Paragraphs labeled "See also:" contain cross-references to the relevant portions of this International Standard and the ISO C standard. Note by the way that section 20.4 is informative, not normative. The same is true of the subsection containing the requisite paragraph (that "incorporates" an ISO C standard) in C++98, C++03, C++11, and C++14. > I don't believe any of the following "See also" references point > to anything in section 6 of the C standard. Most of them refer to > other sections of the C++ standard, most of the rest refer to ISO > C section 7, and a handful refer to section 5, which is where the > C standard defines and . > > As far as I know, nothing in the C++ standard depends on section 6 > of the C standard. The core language is defined from scratch. AFAIK the same is true of C++98, C++03, C++11, and C++14, and that is consistent with those instances of the C++ standard having incorporated (some instance of) the ISO C standard. > Whether the C++ standard incorporates the entire C standard or > not, it doesn't *need* to incorporate section 6 -- and as of > C++17, that wording was removed. Apparently nothing *needs* to be incorporated, since in C++17 nothing was. It's an editorial choice, nothing more, and has no effect on the C++ language being defined. > The change was made in response to > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0063r3.html > "C++17 should refer to C11 instead of C99" > https://github.com/cplusplus/draft commit 6b05dff5 I didn't read the document, but judging from the quoted summary the decision to take out the "is incorporated" clause looks like an independent change. Again, simply an editorial choice, and that is reinforced by section 20.4 being informative rather than normative.