Thread (6 messages) 6 messages, 5 authors, 2020-08-18

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

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2020-08-17 21:37:22
Also in: lkml

On Mon, Aug 17, 2020 at 2:15 PM Eric W. Biederman [off-list ref] 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 allow the "put variable declarations
anywhere" when we've been able to keep from doing it until now.

We're still building primarily good old K&R ANSI C, just with
extensions. Wild variable placement doesn't seem like a useful
extension.

(Other variable placement improvements are: block-scope variable
declarations inside the "for()" statement is very syntactically
useful, for example. THAT would be useful if we can finally enable it
without gcc going all wonky on us)

                Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help