Ah thanks for the correction! and sorry for the confusion, I had a wrong model of the memory layout for this kind of arrays (I thought each struct would be stored inline in the array). So here the undefined reference is not in A
but in the array (so the compiler needs to add a check for #undef
when accessing the array).
Then it’s better than I thought: it’s easier to check an array is well initialized, than to check initialization of all struct fields.
In other words,
x.f
orx[i]
can be undefined butx
cannot ever be undefined. That’s an significant difference and I’m not sure why you’re trying to insist that it’s no difference at all.
Not sure what you mean: I’m talking about these undefined x.f
and x[i]
, not undefined x
.
The point still stands with “opt out” being available (and to some extent also undefined array elements), though not as strongly as I thought.