C++ Logo


Advanced search

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

From: Florian Weimer <fw_at_[hidden]>
Date: Wed, 12 Aug 2020 18:50:43 +0200
I tried to compile a bunch of C software with a C++ compiler, and
designated initializers pose a compatibility problem, even with a
compiler that implements P0329R4.

Would it be possible to lift the ordering constraint? No such
constraint exists for mem-initializers in constructors, which have the
same issue regarding destruction order.

The reason I'm asking for this is that historically, C-related
standard such as POSIX have not specified the order of struct members,
only that certain types must have certain members. This means that
there is no single portable order for designated initializers.

The other issue I encountered is use of nested designators. I'm not
sure if theire use is actually rare.

I'm Cc:ing the C/C++ liaison list, in case others want to chime in.

Received on 2020-08-12 11:54:10