On Tue, 9 Feb 2021 at 01:26, Doug Evans <d...@google.com> wrote: > On Mon, Feb 8, 2021 at 9:17 AM Peter Maydell <peter.mayd...@linaro.org> wrote: >> Don't put local variable declarations in the middle of functions, >> please. Coding style says they should be at the start of a >> block (so, here, the start of the function). It looks like you've >> got middle-of-function declarations in several places in other >> functions too, so could you fix them all up please? > > > Fixed in v3. > Maybe now's a good time though to revisit this rule. > QEMU uses C99, and mixed decls/statements is an easy improvement to the > coding standards. > I'm guessing this is an uncontroversial request. Is there just inertia behind > not making the change thus far?
My personal opinion is that having declarations in the middle of functions is uglier. CODING_STYLE.rst already notes that we have an occasional-exception if there are #ifdefs involved, so we don't have the style rule because we're trying to work with compilers that don't accept middle-of-block declarations. thanks -- PMM