Menu

#3584 Initialization of union / struct with anoymous members

open
nobody
None
Front-end
5
2023-06-07
2023-05-13
No

It looks likely that C23 will change initialization of struct/union with unnamed non-bit-field members.
While SDCC is apparently close to the letter of the current standard¹, most other well-known implementations (GCC, clang, MSVC) do it differently, and C23 might follow them.
Once there is an official proposal I'll link to it here.

¹ At this point it seems likely that the wording of the standard was an accident. In the relevant part, it talks about unnamed members, which pre-C11 always meant unnamed bit-fields; when C11 introduced anonymous struct and union members of struct and union, this meant that the same wording now also applied to them.

Discussion


Log in to post a comment.

Auth0 Logo