|
From: | Daniele Buono |
Subject: | Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings |
Date: | Mon, 26 Oct 2020 11:03:33 -0400 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 |
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/ipl.h:161:23: error: field 'iplb' with variable sized type 'IplParameterBlock' (aka 'union IplParameterBlock') not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
IplParameterBlock iplb; ^../qemu-cfi-v3/hw/s390x/ipl.h:162:23: error: field 'iplb_pv' with variable sized type 'IplParameterBlock' (aka 'union IplParameterBlock') not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
IplParameterBlock iplb_pv; My understanding is that each of these IplParameterBlock may contain either a IPLBlockPV or a IplBlockFcp, which both end with a variable sized field (an array). Adding maintainers of s390x to see if they have a suggested solution to avoid disabling the warning. On 10/26/2020 5:50 AM, Paolo Bonzini wrote:
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-endThis is potentially a real bug, in this case it works only because UASStatus's packet is never uas_iu_command (which has the variable sized type). The QTAILQ_ENTRY need not be at the end, please rearrange UASStatus's field so that the "usb_ui status" field is the last. Thanks, Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |