[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <928d9094-db54-7b27-98a6-9ece514f12e1@kernel.dk>
Date: Tue, 15 Nov 2022 16:09:29 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Ammar Faizi <ammarfaizi2@...weeb.org>
Cc: Pavel Begunkov <asml.silence@...il.com>,
Stefan Metzmacher <metze@...ba.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
io-uring Mailing List <io-uring@...r.kernel.org>,
GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>
Subject: Re: [PATCH v1 2/2] io_uring: uapi: Don't use a zero-size array
On 11/15/22 2:29 PM, Ammar Faizi wrote:
> From: Ammar Faizi <ammarfaizi2@...weeb.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
Powered by blists - more mailing lists