All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Pavel Machek <pavel@ucw.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Michael Witten <mfwitten@gmail.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	John Levon <john.levon@joyent.com>,
	John Levon <levon@movementarian.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Makefile: Yes. Finally remove '-Wdeclaration-after-statement'
Date: Mon, 17 Aug 2020 16:12:09 -0500	[thread overview]
Message-ID: <87lfid6kpi.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <20200817204223.GB12414@amd> (Pavel Machek's message of "Mon, 17 Aug 2020 22:42:24 +0200")

Pavel Machek <pavel@ucw.cz> 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 is complex interaction between compile-time
>> >     configuration options, it's essential to be able to
>> >     make declarations where needed; otherwise unnecessary
>> >     gymnastics are required to silence the compiler.
>> > 
>> > Gentleman... Just let people say exactly what they mean to say.
> ..
>
>> You obviously need every bit of help in that task, judging by the amount
>> of clarity (or thoughts, for that matter) visible in the spew above...
>> 
>> NAK.  And as for letting people say exactly what they mean to say...
>> I am tempted to take you on that invitation, but that would be cruel
>> to gregkh - he would have to reply to inevitable screeds about
>> CoC-violating postings on l-k.
>
> We should really get rid of CoC, because I'd really like to see you
> _not_ resist that temptation.
>
> But... he's right.
>
> With rust-like programming style with widespread consts, this warning
> has to go. And it is causing additional/ugly #ifdefs in some cases.
>
> Maybe author can show examples in kernel .c where disabling the
> warning would lead to nicer code. I believe we should give it a try.


This change came in with 535231e8252e ("[PATCH] add
-Wdeclaration-after-statement").  AKA
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=535231e8252eea14abf4f14d28f6c1c03f5e0f02

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.
The actual commit says that it was in reaction to gcc miscompiling proc.
Which is a far more serious thing.

With all of the our bumping of our gcc version lately perhaps it is safe
to remove this warning.

Eric

  reply	other threads:[~2020-08-17 21:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16 16:35 [PATCH] Makefile: Yes. Finally remove '-Wdeclaration-after-statement' Michael Witten
2020-08-16 17:53 ` Al Viro
2020-08-17 20:42   ` Pavel Machek
2020-08-17 21:12     ` Eric W. Biederman [this message]
2020-08-17 21:29       ` Linus Torvalds
2020-08-17 22:09         ` Pavel Machek
2020-08-17 22:12           ` Linus Torvalds
2020-08-18  5:17             ` Ingo Molnar
2020-08-18  8:56               ` David Laight
2020-08-16 17:56 ` Joe Perches
2020-08-17  3:37   ` Michael Witten
2020-08-17  4:19     ` Joe Perches
2020-08-17 11:40       ` Michael Witten
2020-08-17 20:38       ` Pavel Machek
2020-08-18 22:05     ` Michael Witten
2020-08-19 21:15       ` Michael Witten
2020-08-20  0:15         ` [RFC v2] kbuild: Introduce "Warnings for maintainers" Michael Witten

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfid6kpi.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=john.levon@joyent.com \
    --cc=levon@movementarian.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mfwitten@gmail.com \
    --cc=michal.lkml@markovi.net \
    --cc=pavel@ucw.cz \
    --cc=sam@ravnborg.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.