On Mon, Jun 22, 2009 at 10:43 PM, Miles Bader<mi...@gnu.org> wrote:
> Gabriel Dos Reis <dosr...@gmail.com> writes:
>> Historically, many C programmers have resisted that idea (even when we could
>> argue that it really is bad style programming.)
>
> They have?(!)
>
> This warning warns about:   goto L; { int x = 3; L: ... }
> but not about:              goto L; { int x; L: ... }
> right?

Yes.

>
> So... is the idea that there might be code that assigns to x after L:,
> before the first use of x, making the warning superfluous?

Some of it are like that; some of it are when 'x' is not used after L.  Some of
it are more convoluted.

Please note that I do consider that bad programming style.
My 'middle ground' proposal was to enforce warn at -Wall for C99 -- because
you're like to find more declarations (and therefore initializations)
in the middle of blocks that are jumped over, than you would in C90.
And have it at -Wextra for C90 -- and of course it will be part of -Wc++-compat.

-- Gaby

Reply via email to