C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] Designated initializers in C++ and C

From: Bjarne Stroustrup <bjarne_at_[hidden]>
Date: Wed, 12 Aug 2020 22:08:11 +0200
On 8/12/2020 9:37 PM, Jens Gustedt via Liaison wrote:
> IIRC, in C, initializer expressions within the same initializer are
> unsequenced. So the above code would not have defined behavior in C.

Some of us are not too happy with easy-to-write-by-accident undefined
behavior that is not reliably detected by all compilers.


>
> Hm, that looks as if WG21 implemented a completely different feature
> than WG14:(


And W14 implemented differing definitions of inline, complex, and const,
after years of use in C++.  Compatibility is seriously hard and there is
a lot of history to this. Please remember that some of us have tried to
keep up with the C standards effort since before the 1989 standard. With
two different standards and two different groups of people maintaining
them, we will continue to get a number of deliberate and accidental
incompatibilities. I have dreamed of a merger of C and C++ since the
late 1980s, and I am not alone, but there are enough people (on both
sides) insisting on incompatibilities that I am not optimistic about that.

Received on 2020-08-12 15:11:39