[RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error

Philippe Mathieu-Daudé posted 2 patches 3 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210118170308.282442-1-philmd@redhat.com
Test checkpatch passed
There is a newer version of this series
include/scsi/utils.h |  2 ++
hw/usb/dev-uas.c     | 12 +++++++++++-
scsi/utils.c         |  5 +++++
3 files changed, 18 insertions(+), 1 deletion(-)
[RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error
Posted by Philippe Mathieu-Daudé 3 years, 3 months ago
Another attempt to fix the following Clang 11 warning:

  usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_i=
u' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-vari=
able-sized-type-not-at-end]
      uas_iu                    status;
                                ^
If a guest send a packet with additional data, respond
with "Illegal Request - parameter not supported".

Philippe Mathieu-Daud=C3=A9 (2):
  scsi/utils: Add INVALID_PARAM_VALUE sense code definition
  hw/usb/dev-uas: Report command additional adb length as unsupported

 include/scsi/utils.h |  2 ++
 hw/usb/dev-uas.c     | 12 +++++++++++-
 scsi/utils.c         |  5 +++++
 3 files changed, 18 insertions(+), 1 deletion(-)

--=20
2.26.2


Re: [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error
Posted by Gerd Hoffmann 3 years, 3 months ago
On Mon, Jan 18, 2021 at 06:03:06PM +0100, Philippe Mathieu-Daudé wrote:
> Another attempt to fix the following Clang 11 warning:
> 
>   usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_i=
> u' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-vari=
> able-sized-type-not-at-end]
>       uas_iu                    status;
>                                 ^
> If a guest send a packet with additional data, respond
> with "Illegal Request - parameter not supported".

Why rfc?  looks good to me as-is ;)

thanks,
  Gerd


Re: [RFC PATCH 0/2] hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error
Posted by Philippe Mathieu-Daudé 3 years, 3 months ago
On 1/19/21 5:41 PM, Gerd Hoffmann wrote:
> On Mon, Jan 18, 2021 at 06:03:06PM +0100, Philippe Mathieu-Daudé wrote:
>> Another attempt to fix the following Clang 11 warning:
>>
>>   usb/dev-uas.c:157:31: error: field 'status' with variable sized type 'uas_i=
>> u' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-vari=
>> able-sized-type-not-at-end]
>>       uas_iu                    status;
>>                                 ^
>> If a guest send a packet with additional data, respond
>> with "Illegal Request - parameter not supported".
> 
> Why rfc?  looks good to me as-is ;)

Sorry I forgot to explain. RFC because I don't know enough SCSI
to be sure than the device returning sense_code_INVALID_PARAM_VALUE
on the bus is appropriate. This is the best fit I could find.

> 
> thanks,
>   Gerd
>