lkml.org 
[lkml]   [2022]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 2/2] io_uring: uapi: Don't use a zero-size array
From
On 11/15/22 2:29 PM, Ammar Faizi wrote:
> From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
>
> 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


\
 
 \ /
  Last update: 2022-11-16 00:10    [W:0.109 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site