https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70911

--- Comment #2 from Alexander Cherepanov <ch3root at openwall dot com> ---
I think it's misleading. IMHO "overwritten" would describe the situation 
when the first initializer is evaluated, the resulting value is written 
to the field but then the second initializer overwrites the first value 
with its own.

This impression is wrong even without side effects (i.g., for "warning: 
initialized field overwritten [-Woverride-init]") because it implies 
that this declaration:

struct { int x, y; } s = { .x = 1, .y = s.x, .x = 2 };

will set s.y to 1 while with gcc it will set it to 2.

The problem is worse with side effects because "overwritten" implies 
that a value is overwritten but the side effects are occurred while with 
gcc they didn't occur.

Hm, probably a noun is more important here than a verb. Field is 
overwritten but initializer is overridden. And the warning is really 
about initializer.

Reply via email to