qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>, Thomas Huth <thuth@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] build: try improve handling of clang warnings
Date: Fri, 9 Mar 2018 14:55:37 +0100	[thread overview]
Message-ID: <20180309135537.vnrsyup73dtatj23@sirius.home.kraxel.org> (raw)
In-Reply-To: <CAFEAcA8e43LTexse9Dq_V-d-4zb5YeT6hUQ8xH1YZ-fCWL0qTg@mail.gmail.com>

On Fri, Mar 09, 2018 at 11:32:30AM +0000, Peter Maydell wrote:
> On 9 March 2018 at 11:01, Gerd Hoffmann <kraxel@redhat.com> wrote:
> > This patch disables the pragma diagnostic -Wunused-but-set-variable for
> > clang in util/coroutine-ucontext.c.
> >
> > This in turn allows us to remove it from the configure check, so the
> > CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE will succeed for clang.
> >
> > With that in place clang builds (linux) will use -Werror by default,
> > which breaks the build due to warning about unaligned struct members.
> >
> > Given that our structs are often dictated by the hardware qemu emulates
> > and the file formats we use this can't be fixed easily, so I think it is
> > reasonaable to turn off this warning.  Do so by adding
> > -Wno-address-of-packed-member to our list of warning flags.
> 
> I disagree with this part. Everywhere we do this is at least
> plausibly a bug, and we should fix the bugs. Taking addresses of
> members in packed structs and then passing them to functions will
> break on some architectures, because it drops the information that
> the field is not at an aligned address.

Ok, I guess I pick up Thomas' idea then and turn it into a warning using
-Wno-error=address-of-packed-member.  That way it will not fail the
build with -Werror, but we still see it in the logs.

cheers,
  Gerd

      reply	other threads:[~2018-03-09 13:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 11:01 [Qemu-devel] [PATCH] build: try improve handling of clang warnings Gerd Hoffmann
2018-03-09 11:28 ` Philippe Mathieu-Daudé
2018-03-09 11:31 ` Thomas Huth
2018-03-09 11:32 ` Peter Maydell
2018-03-09 13:55   ` Gerd Hoffmann [this message]

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=20180309135537.vnrsyup73dtatj23@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.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 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).