Skip to content

c23 aggregate initialization #78034

Closed
Closed
@uecker

Description

@uecker

It seems clang recently started to miscompile aggregate initialization.

union foo {
    char x;
    int  y;
    long z;
} x = { 0 };

would only initialize x, which is OK (although a questionable decision). But my understanding is that
for C23 x = { } zero-filling is required, and this also does not happen anymore.

https://godbolt.org/z/68q9bY5cT

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions