C++ Logo

liaison

Advanced search

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

From: Jens Gustedt <jens.gustedt_at_[hidden]>
Date: Thu, 13 Aug 2020 12:01:41 +0200
Florian,

on Thu, 13 Aug 2020 11:46:41 +0200 you (Florian Weimer
<fw_at_[hidden]>) wrote:

> * Jens Gustedt via Liaison:
>
> >
> > It is recommended that applications that target the common
> > C/C++ core list initializers in declaration order. Further it is
> > recommended that implementations that target that core
> > diagnose situations that would be problematic for the other
> > language, such as initializers not appearing in declaration order or
> > initializer expressions that require sequencing.
>
> I think you should also recommend that standards specify the order of
> struct fields, and not just that the fields exist.

Interesting idea. I have not followed that vein of making
recommendations for depending standards, yet. For the moment they are
treated as "applications". Hm.

Also we even have that problem within the C standard itself. E.g the
structures in <time.h> have a specification that allows any order of
the fields. And even worse, I think that some implementations even
have them in different orders than listed.

So here, a general recommendation would then also be for
implementations to use the order as specified.

Jens

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2020-08-13 05:05:12