← Back to context

Comment by WalterBright

4 days ago

D is consistent in that structs also default initialize:

    struct S { int a; float f; }
    S s;

For C, having an error when the initializer is omitted is better than nothing. However, that is not part of the C Standard, and you'll be relying on having a C compiler with that extension. Otherwise there is undefined behavior. To do it right means it needs to be standardized.