[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cd9642a2-3f09-46c8-51bc-2c359b8b3f0b@gnuweeb.org>
Date: Wed, 16 Nov 2022 17:28:58 +0700
From: Ammar Faizi <ammarfaizi2@...weeb.org>
To: Pavel Begunkov <asml.silence@...il.com>,
Jens Axboe <axboe@...nel.dk>
Cc: 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/16/22 5:14 PM, Pavel Begunkov wrote:
> On 11/15/22 21:29, 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:
>
> Ammar, I'd strongly encourage you to at least compile your
> patches or even better actually test them. There is an explicit
> BUILD_BUG_ON() violated by this change.
Oh yeah, I didn't realize that. This patch breaks this assertion:
BUILD_BUG_ON failed: sizeof_field(struct io_uring_sqe, cmd) != 0
This assertion wants the size of cmd[] to be zero. Which is obviously
violated in this patch.
I only tested a liburing app that uses this header and validated
that the struct size is the same, but not its field. That's my
mistake.
I'm *not* going to send a v2 per Jens' comment.
--
Ammar Faizi
Powered by blists - more mailing lists