Sunday, August 15, 2021

Digest for comp.lang.c++@googlegroups.com - 4 updates in 1 topic

James Kuyper <jameskuyper@alumni.caltech.edu>: Aug 15 12:40AM -0400

On 8/14/21 4:33 PM, Juha Nieminen wrote:
> part of this standard as well". In other words, *only* the referenced
> parts.
 
> I could be wrong, of course.
 
As Tim pointed out, that interpretation is inconsistent with the use of
the singular verb - "referenced parts" is plural. There's a simple,
obvious singular thing that is the corresponding subject, and that's
"the ISO C standard".
 
As Keith pointed out, while this is linguistically correct, it's
probably not the intent. Virtually the entirety of section 6 of the C
standard is duplicated in the C++ standard, with modifications that in
many places make it incompatible with the the wording in the C standard,
making it questionable what it would mean for section 6 to be
incorporated by reference. The changed wording in C++2017 is almost
certainly what was intended all along.
Tim Rentsch <tr.17687@z991.linuxsc.com>: Aug 15 07:02AM -0700


> 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.
 
> 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".
 
 
> 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.
 
> C standard defines <limits.h> and <float.h>.
 
> 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.
 
> 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.
"Alf P. Steinbach" <alf.p.steinbach@gmail.com>: Aug 15 09:19PM +0200

On 15 Aug 2021 16:02, Tim Rentsch wrote:
 
> 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 minimum ranges for integer types, except `char`, are not specified
explicitly in the C++ standard, and as I recall there's not even a
specific reference to the C standard for that. Yet these ranges are
provided by the C standard. Any reasonable interpretation has to make
that happen.
 
- Alf
Richard Damon <Richard@Damon-Family.org>: Aug 15 03:42PM -0400

On 8/15/21 3:19 PM, Alf P. Steinbach wrote:
> provided by the C standard. Any reasonable interpretation has to make
> that happen.
 
> - Alf
 
17.3.6 Header <climits> synopsis
 
1 The header <climits> defines all macros the same as the C standard
library header <limits.h>.
 
 
This at least seems to pull in the C standard definitions which include
their allowable range.
 
(From N4860]
 
Other versions had some sort of similar reference to climits and
limits.h that at least imply that these macros have the same sort of values.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: