Bruno Haible wrote:
Can someone answer this?
I expect the warning is there because of style reasons, not correctness reasons.
That is, although it's natural when seeing this line:
int x = 10;
to assume that X must always be initialized, this assumption is incorrect if a
goto jumps over the declaration. As a style matter, perhaps some C programmers
want a warning if their code violates this natural assumption.
That being said, the warning is not emitted if the program simply does this
instead:
int x; x = 10;
so it does seem a bit ridiculous to enable the warning, and it'd be fine with me
if we removed it from manywarnings.