IIRC this variable declaration in the middle of a code block has been an issue in the linux kernel as well, and variable declarations in the midst of code is not allowed.
It comes from C++. ANSI C++ allows it. I thought that ANSI C did too. Ah well.
ron