Re: [PATCH v1 2/2] io_uring: uapi: Don't use a zero-size array

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

 



On 11/15/22 2:29 PM, Ammar Faizi wrote:
> From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
> 
> Don't use a zero-size array because it doesn't allow the user to
> compile an app that uses liburing with the `-pedantic-errors` flag:
> 
>   io_uring.h:611:28: error: zero size arrays are an extension [-Werror,-Wzero-length-array]
> 
> Replace the array size from 0 to 1.
> 
>   - No functional change is intended.
>   - No struct/union size change.

The only reason why they don't grow the struct, is because it's in
a union. I don't like this patch, as the zero sized array is a clear
sign that this struct has data past it. If it's a single entry, that's
very different.

Yes that apparently makes pendantic errors unhappy, but I care more
about the readability of it.

-- 
Jens Axboe





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux