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

2020-08-19 Thread Michael Witten
The quick RFC patch I just proposed in the parent email is broken in its implementation. I will submit an updated version soon. Michael Witten (Tue, 18 Aug 2020 22:05:00 -): > I think there's an important distinction to make between > the following 2 kinds of code: > > * The curated code

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

2020-08-18 Thread Michael Witten
I think there's an important distinction to make between the following 2 kinds of code: * The curated code people just want to build. * The new patches that maintainers are reviewing. Certainly, maintainers should have a wide range of tools at their disposal to probe the quality of a patch;

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

2020-08-18 Thread David Laight
> I'm a big fan of -Wdeclaration-after-statement and I think C++ style > mixed variables/statements code has several disadvantages: Agreed. Personally I think declarations should either be either right at the top of a function or in a very small code block. Otherwise they are annoying to find.

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

2020-08-17 Thread Ingo Molnar
* Linus Torvalds wrote: > On Mon, Aug 17, 2020 at 3:09 PM Pavel Machek 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

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

2020-08-17 Thread Linus Torvalds
On Mon, Aug 17, 2020 at 3:09 PM Pavel Machek 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.

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

2020-08-17 Thread Pavel Machek
On Mon 2020-08-17 14:29:37, Linus Torvalds wrote: > On Mon, Aug 17, 2020 at 2:15 PM Eric W. Biederman > wrote: > > > > Does anyone remember why we added this warning? I had always thought > > it's purpose was to ensure we stayed within our chosen dialect of C. > > As far as I'm concerned,

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

2020-08-17 Thread Linus Torvalds
On Mon, Aug 17, 2020 at 2:15 PM Eric W. Biederman wrote: > > Does anyone remember why we added this warning? I had always thought > it's purpose was to ensure we stayed within our chosen dialect of C. As far as I'm concerned, that's the primary motivation. I'm not seeing why we'd suddenly

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

2020-08-17 Thread Eric W. Biederman
Pavel Machek writes: > Hi! > >> > This is not just a matter of style; this is a matter of semantics, >> > especially with regard to: >> > >> > * const Correctness. >> > A const-declared variable must be initialized when defined. >> > >> > * Conditional Compilation. >> > When there

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

2020-08-17 Thread Pavel Machek
Hi! > > This is not just a matter of style; this is a matter of semantics, > > especially with regard to: > > > > * const Correctness. > > A const-declared variable must be initialized when defined. > > > > * Conditional Compilation. > > When there is complex interaction between

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

2020-08-17 Thread Pavel Machek
On Sun 2020-08-16 21:19:23, Joe Perches wrote: > On Mon, 2020-08-17 at 03:37 +, Michael Witten wrote: > > Matters of style should probably not be enforced by the build > > infrastructure; style is a matter for the maintainer to enforce: > > I rather doubt style advice should be taken from

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

2020-08-17 Thread Michael Witten
Joe Perches (Sun, 16 Aug 2020 10:56:53 -0700): > On Mon, 2020-08-17 at 03:37 +, Michael Witten wrote: >> Matters of style should probably not be enforced by >> the build infrastructure; style is a matter for the >> maintainer to enforce: > > I rather doubt style advice should be

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

2020-08-16 Thread Joe Perches
On Mon, 2020-08-17 at 03:37 +, Michael Witten wrote: > Matters of style should probably not be enforced by the build > infrastructure; style is a matter for the maintainer to enforce: I rather doubt style advice should be taken from someone who right justifies fixed pitch block text.

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

2020-08-16 Thread Michael Witten
Joe Perches (Sun, 16 Aug 2020 10:56:53 -0700): > I rather prefer block declarations instead of > sprinkling declarations around with code. Hey, we all have our guilty pleasures. Fortunately, even with this patch, you'd still be able to indulge in your preferred style, or even enforce it among

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

2020-08-16 Thread Joe Perches
On Sun, 2020-08-16 at 16:35 +, Michael Witten wrote: > Requiring every declaration to be at the top of a block is an > antiquated, vestigial naivete from a time when C was just a > glorified abstraction over conventional patterns in assembly > programming. I rather prefer block declarations

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

2020-08-16 Thread Al Viro
On Sun, Aug 16, 2020 at 04:35:00PM -, Michael Witten wrote: > This is not just a matter of style; this is a matter of semantics, > especially with regard to: > > * const Correctness. > A const-declared variable must be initialized when defined. > > * Conditional Compilation. >

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

2020-08-16 Thread Michael Witten
This is not just a matter of style; this is a matter of semantics, especially with regard to: * const Correctness. A const-declared variable must be initialized when defined. * Conditional Compilation. When there is complex interaction between compile-time configuration options,