Re: [PATCH] Makefile: Yes. Finally remove '-Wdeclaration-after-statement'

From: Linus Torvalds
Date: Mon Aug 17 2020 - 18:13:29 EST


On Mon, Aug 17, 2020 at 3:09 PM Pavel Machek <pavel@xxxxxx> wrote:
>
> Submitter believes "wild variable placement" can help with
> #ifdefs.. and that may be actually good tradeoff.

I agree that it can help in some cases.

But it can also make it really hard to find the variable declarations
in other cases. I've seen a lot of code that ends up actively
declaring the variable close to where it's used (because people find
that to be locally more legible) and then it just means that people
who arent' familiar with the code have a much harder time finding it.

I'd instead try to discourage people from using #ifdef's inside code.

Linus