qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] build: try improve handling of clang warnings


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH] build: try improve handling of clang warnings
Date: Fri, 9 Mar 2018 14:55:37 +0100
User-agent: NeoMutt/20180223

On Fri, Mar 09, 2018 at 11:32:30AM +0000, Peter Maydell wrote:
> On 9 March 2018 at 11:01, Gerd Hoffmann <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]