C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] labels

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Wed, 12 Aug 2020 15:44:50 +0300
On Wed, 12 Aug 2020 at 15:29, Bjarne Stroustrup via Liaison
<liaison_at_[hidden]> wrote:
> > 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. 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?
>
> 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. 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.

Allowing labels before declarations in C seems fine, that's a
compatibility fix that C can make to be
more compatible with C++. Introducing the allowance of labels at the
end of a compound statement to C
and then complaining that C++ is not compatible seems a bit rich,
because it doesn't seem like the
cost/benefit ratio of that change in C is all that great.

Having said that, disallowing such labels seems.. ..draconian. It
seems to be almost a "you diagnose this
as a label at the end of a compound statement, so perhaps just drop
the diagnostic and accept the program?".

I don't see this change as anything really sinister or having wide
impact, modulo implementation churn;
it seems to be a miniature usability improvement. At the end of it, it becomes
a question of whether it's worth doing when everybody can just add the
null statements where required, and it's
not hard to find why and how to do that.

Received on 2020-08-12 07:48:25