Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-27 Thread Daniele Buono
So what I would do for the warning in IplParameterBlock is the following (if I got the comments right): - Remove IplBlockFcp from IplParameterBlock - Keep IPLBlockPV and, in its declaration, use struct IPLBlockPVComp components[0]; Now for the IplBlockFcp struct declaration, it does not seem to

Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-27 Thread Cornelia Huck
On Tue, 27 Oct 2020 12:26:21 +0100 Thomas Huth wrote: > On 26/10/2020 16.12, Paolo Bonzini wrote: > > On 26/10/20 16:03, Daniele Buono wrote: > >> Hi Paolo, > >> I reorganized UASStatus to put uas_iu at the end and it works fine. > >> Unfortunately, this uncovered another part of the code with

Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-27 Thread Thomas Huth
On 26/10/2020 16.12, Paolo Bonzini wrote: > On 26/10/20 16:03, Daniele Buono wrote: >> Hi Paolo, >> I reorganized UASStatus to put uas_iu at the end and it works fine. >> Unfortunately, this uncovered another part of the code with a similar >> issue (variable sized type not at the end of the struct

Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-26 Thread Peter Maydell
On Mon, 26 Oct 2020 at 15:13, Paolo Bonzini wrote: > This one seems okay because the union constrains the size to 4K. If > "[0]" is enough to shut up the compiler, I'd say do that. Do you mean converting a C flexible array member (declared as "foo[]") into a gcc zero-length array (declared as "fo

Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-26 Thread Daniele Buono
Using an array of length 0 seems to be enough to avoid the warning Will use that solution in v3. Thanks, Daniele On 10/26/2020 11:12 AM, Paolo Bonzini wrote: On 26/10/20 16:03, Daniele Buono wrote: Hi Paolo, I reorganized UASStatus to put uas_iu at the end and it works fine. Unfortunately, thi

Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-26 Thread Paolo Bonzini
On 26/10/20 16:03, Daniele Buono wrote: > Hi Paolo, > I reorganized UASStatus to put uas_iu at the end and it works fine. > Unfortunately, this uncovered another part of the code with a similar > issue (variable sized type not at the end of the struct), here: > > In file included from ../qemu-cfi-

Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-26 Thread Daniele Buono
Hi Paolo, I reorganized UASStatus to put uas_iu at the end and it works fine. Unfortunately, this uncovered another part of the code with a similar issue (variable sized type not at the end of the struct), here: In file included from ../qemu-cfi-v3/target/s390x/diag.c:21: ../qemu-cfi-v3/hw/s390x/

Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-26 Thread Paolo Bonzini
On 23/10/20 22:06, Daniele Buono wrote: > 1 error generated. > > The data structure is UASStatus, which must end with a QTAILQ_ENTRY, so > I believe we cannot have uas_iu at the end. Since this is a gnu > extension but CLANG supports it, just add > -Wno-gnu-variable-sized-type-not-at-end This is

Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-24 Thread Daniele Buono
On 10/24/2020 1:17 AM, Thomas Huth wrote: Compiling all code with -Wno-void-pointer-to-enum-cast sounds like the wrong approach to me, since this might hide some real bugs in other spots instead. Could you please try to cast the value through (uintptr_t) first, e.g. : S390Feat feat = (S390

Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-23 Thread Thomas Huth
On 23/10/2020 22.06, Daniele Buono wrote: > Clang 11 finds a couple of spots in the code that trigger new warnings: > > ../qemu-base/hw/usb/dev-uas.c:157:31: error: field 'status' with variable > sized type 'uas_iu' not at the end of a struct or class is a GNU extension > [-Werror,-Wgnu-variable

[PATCH v2 2/6] configure: avoid new clang 11+ warnings

2020-10-23 Thread Daniele Buono
Clang 11 finds a couple of spots in the code that trigger new warnings: ../qemu-base/hw/usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_iu' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end] uas_iu