tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: declarations in switch statements (Re: wedges on vnd(4) patch)
In article <20100622182446.GA3777%nimenees.com@localhost>,
Eric Haszlakiewicz <erh%nimenees.com@localhost> wrote:
>
>btw, there's a 5th option that is a bit in between:
>switch (c) {
> int myvar;
>case 'a':
> myvar = somevalue;
> stmt;
>}
>
>but I wouldn't recommend it b/c variable initialization on the declaration line
>happens in a non-obvious way (or rather, it *doesn't* happen).
And there is no warning at all.
christos
Home |
Main Index |
Thread Index |
Old Index