C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] labels

From: Uecker, Martin <Martin.Uecker_at_[hidden]>
Date: Wed, 12 Aug 2020 14:19:15 +0000
Am Mittwoch, den 12.08.2020, 14:28 +0200 schrieb Bjarne Stroustrup:
> On 8/12/2020 12:05 PM, Uecker, Martin wrote:
> > Am Mittwoch, den 12.08.2020, 11:54 +0200 schrieb Bjarne Stroustrup:
> > > On 8/12/2020 11:39 AM, Uecker, Martin wrote:
> > > > You are not programming in C I assume.
> > >
> > > You are right. It's a long time since I wrote (and generated) a lot of
> > > C. Given my previous extensive experience with C and contribution to C,
> > > I don't think that disqualifies me from commenting.
> >
> > This is not the question, but it may explain a different
> > view on the importance of this change.
>
> Possibly, but to me, "several people I talked to liked it" doesn't sound
> like a solid argument for a change being important.

Well, there is one change which has two consequences:

- allowing labels for declarations (already allowed
  in C++ but not yet in C)

- allowing labels at the end of a compound statement
  (not allowed in any language)


What was considered important was primarily the first
change, also for compatibility with C++. But in the
way the language is stuctured since C99, a simple
and natural change in C can be used to implement both
at the same time and this is exactly what was done.

There was no reason to explicitly forbid the second
case, as it also seemed useful and more logical to
allow it.

> That would be true
> for both C and C++. I am still wondering how people could ever consider
> this particular change sufficiently important to be worthwhile. Is there
> a design rationale that I can consult?

The documents mentioned in my original email, but
I am also happy to discuss this more on this list.

I couldn't find a rationale for the declaration
statements in C++. If there is document, I would
also appreciate a pointer.


> Not all people in the C++ committee appreciate C/C++ compatibility, but
> I think that most do, and I do. I'm all for C/C++ compatibility, but it
> should be a two-way street.

In my opinion, there should also be some consensus
about what we aim for. Obviously there are plenty of
things in C++ not compatible with C and vice versa.

Better header compatibility would be an important goal,
for example, and there is much left to be desired.

> When considering changes to C++, the
> implications to C are considered, typically by people with deep and
> long-term knowledge of C, incl. people who write C compilers.

I don't question the expertise of the people involved.
But I would assume these area primarily C++ people, where
a compiler framework also supports C in addition to C++.

It would be helpful if WG14 is more closely involved in
such discussions, as there are also other parts of the
C community whose input could be important.

Best,
Martin

Received on 2020-08-12 09:22:43