linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] [v2] waitqueue: shut up clang -Wuninitialized warnings
Date: Tue, 23 Jul 2019 13:21:59 -0700	[thread overview]
Message-ID: <20190723202159.GA79273@archlinux-threadripper> (raw)
In-Reply-To: <CAK8P3a3_sRmHVsEh=+83zR_Q3+Bh9fd+-iiCxt4PU4gkx0HZ7Q@mail.gmail.com>

On Tue, Jul 23, 2019 at 01:03:05PM +0200, Arnd Bergmann wrote:
> On Tue, Jul 23, 2019 at 12:50 PM Peter Zijlstra <peterz@infradead.org> wrote:
> > On Fri, Jul 19, 2019 at 01:36:00PM +0200, Arnd Bergmann wrote:
> > > --- a/include/linux/wait.h
> > > +++ b/include/linux/wait.h
> > > @@ -70,8 +70,17 @@ extern void __init_waitqueue_head(struct wait_queue_head *wq_head, const char *n
> > >  #ifdef CONFIG_LOCKDEP
> > >  # define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \
> > >       ({ init_waitqueue_head(&name); name; })
> > > -# define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) \
> > > +# if defined(__clang__) && __clang_major__ <= 9
> > > +/* work around https://bugs.llvm.org/show_bug.cgi?id=42604 */
> > > +#  define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name)                                      \
> > > +     _Pragma("clang diagnostic push")                                        \
> > > +     _Pragma("clang diagnostic ignored \"-Wuninitialized\"")                 \
> > > +     struct wait_queue_head name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name)      \
> > > +     _Pragma("clang diagnostic pop")
> > > +# else
> > > +#  define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) \
> > >       struct wait_queue_head name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name)
> > > +# endif
> >
> > While this is indeed much better than before; do we really want to do
> > this? That is, since clang-9 release will not need this, we're basically
> > doing the above for pre-release compilers only.
> 
> Kernelci currently builds arch/arm and arch/arm64 kernels with clang-8,
> and probably won't change to clang-9 until after that is released,
> presumably in September.
> 
> Anyone doing x86 builds would use a clang-9 snapshot today
> because of the asm-goto support, but so far the fix has not
> been merged there either. I think the chances of it getting
> fixed before the release are fairly good, but I don't know how
> long it will actually take.
> 
>        Arnd

Furthermore, while x86 will only be supported by clang-9 and up, there
are other architectures/configurations that work with earlier versions
that will never see that fix. There are a few people that still use
clang-7 for example.

In an ideal world, everyone should be using the latest version of clang
because of all of the fixes and improvements that are going into that
latest version but the same can be said of any piece of software. I am
not sure that it is fair to force someone to upgrade when it works for
them. Not everyone runs Ubuntu/Debian to get access to apt.llvm.org
builds or wants to add random repositories to their list or wants to
build clang from source.

I suppose it comes down to policy: if we don't want to support versions
of LLVM before 9.x then we should just break the build when it is
detected but Nick has spoken out against that and I think that he has a
fair point.

https://lore.kernel.org/lkml/CAKwvOdnzrMOCo4RRsfcR=K5ELWU8obgMqtOGZnx_avLrArjpRQ@mail.gmail.com/

Cheers,
Nathan

  reply	other threads:[~2019-07-23 20:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19 11:36 [PATCH] [v2] waitqueue: shut up clang -Wuninitialized warnings Arnd Bergmann
2019-07-19 19:00 ` Nathan Chancellor
2019-07-23 10:50 ` Peter Zijlstra
2019-07-23 11:03   ` Arnd Bergmann
2019-07-23 20:21     ` Nathan Chancellor [this message]
2019-07-23 20:54       ` Nick Desaulniers
2019-07-24  7:31         ` Peter Zijlstra

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=20190723202159.GA79273@archlinux-threadripper \
    --to=natechancellor@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).