Re: [PATCH] Drop -Wdeclaration-after-statement

From: Andrew Morton
Date: Tue Mar 12 2019 - 16:53:38 EST


> > >
> > > It is not good in my opinion to stick to -Wdeclaration-after-statement.
> >
> > Why?
>
> It is useful to have declarations mixed with code.

Am inclined to agree. Maybe.

> Once kernel will switch to C99 or C11 it _will_ be used to the point of
> requiring it on the coding style level. The superstition of declaring
> everything in the beginning of a function will fall, so might as well
> start earlier.

Sure, it's a matter of kernel coding conventions.

But this isn't the way to get those changed! The process for making such
changes involves large numbers of people arguing at each other (perhaps
at kernel summit) until Linus comes in an tells everyone how it's going
to be.