Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7628311rwb; Tue, 15 Nov 2022 15:28:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf7j+gbAwULP7a2KB6o/EuMG7XT3eU+9Lii0wdHEdqnjzcUBCZgpnnDnbotUCJIxechq4QvE X-Received: by 2002:a63:942:0:b0:43c:b43f:5228 with SMTP id 63-20020a630942000000b0043cb43f5228mr18971120pgj.58.1668554922888; Tue, 15 Nov 2022 15:28:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668554922; cv=none; d=google.com; s=arc-20160816; b=r70SREuMaA3TRbye/0NPx337cARLOhZbPuBbMU+uQez0azbakC8KLbQDrRlTSrrjHS 3ki8EYNEvet04ayHOZINZ4q/i+xvZmJpuqumgqzm6oo+Qgs1ODn0pDAPRTeBnu+ZWmxD 4gr95A8zC2kzDLZMyH36ay+wkCLYuI8r1RUiB2dBkrSwpEgsKITeHdOBFbk/pZJjUduN BvQFB7ePl30QGNlBYwkpicFMXxetnJmj/1twKJNwFhnCe9so7sraOILVGLRZryAZmgFu Y/Uv9V8uVF1RELPZBi2FzEm+O6n0uywDeNSJRoRqW5psp1WKT31al81Yf79jJiVxvvlb yDvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=FRJ2/NFUMo3tot9W+XQ4AmnzXlCEgzOQj+6LcJx3n5c=; b=B0wJ2zbIWw1+vbwRVolNubM1hdFDb4TbnvAQ6Hr7A+VNBGSm1e1Hs5Q5PguEp5HzLj C+/5WjGzIM0v1lJWBazYTrSyr3aglefZl+xinSoRdvu5qGa9pfU5DssKI5v8IjGLuQX8 86UyOFZkCwXO7OrshTwUIjUNAZsdqbDJPM59XC3t5PL6R9GAqLev6H+u67cvXR9l8S0z ivgN7AyaviBfhIJikf3pF8R3lSXwcaG0zEMS2e9sOVtRXgfJgeTs9vYEJZEdQue6mGGv qmdHE++L7Se4fSeTXFfZJYCh1AkeaQQpcudFmT0S+ezEkvRwxKB08FlUYFfboQw2r4JR u8xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=GSETCmmw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a63e214000000b0046f33e40222si13700900pgh.669.2022.11.15.15.28.00; Tue, 15 Nov 2022 15:28:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=GSETCmmw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbiKOXJg (ORCPT + 91 others); Tue, 15 Nov 2022 18:09:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbiKOXJe (ORCPT ); Tue, 15 Nov 2022 18:09:34 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5E882CC86 for ; Tue, 15 Nov 2022 15:09:31 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id gw22so14906252pjb.3 for ; Tue, 15 Nov 2022 15:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=FRJ2/NFUMo3tot9W+XQ4AmnzXlCEgzOQj+6LcJx3n5c=; b=GSETCmmwbzYAUh1qY2IkDbt0DbmzVOSYoPpFC2XzrI8BtKj567Y45nKLP9gUovi3ig oQH00y9Ev91UkP0KTipKG57JQCkPbBmhj0KvGNP9sJWrKHcWhHK/mdwDu0knzKwSbFGn hyyjbfOPWqTOhSw0zCPDOtZadh2G6OGMTj90qWtII2VogJRv/9icbPbDuVUdyvq02BBc +ZzLOw1rhI6SA1219JOfUnWxhwKEWxzUkn9jX3XLfMUbErQ2GudrFc7HQYnlL5zEtS0q Y0EtV2xxkCmu1ET4xG5vRY51UHjE2Am6tbHozXw083/SeG9YowKv4MUhf+GmeWKt1eKt xMhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FRJ2/NFUMo3tot9W+XQ4AmnzXlCEgzOQj+6LcJx3n5c=; b=AA/BcZy1nRoLCoc8gu8eXh9qK7kzMqCsYAndwdzWXmQFsi7jdZIMCircZfUAJ4LvxJ iraijv0f9/6jlgFOh36n+cjNGXPYzR1WwRTsFFunByGs3sRv66SVzwbrzWhOT7kG6mYe 9mGwPqMuhwX3JCjiiaQkGhhIYsDiL+cQOykQaobB2wLz0cigLZ88iWqxW29B3Dr1DMX3 DOJNNUXaAFP9Zr9btOhksp/30eG0BszDToUhzd4fz23HLFELTdFHBNYIOvfyNZ2QjJLD QDDVa8DMJ9yu1tLLrJ6yZc+iBLV3aNG0z2Bclxllc+2M7lsquhxdoSsuBAoPJX9kSLND raVw== X-Gm-Message-State: ANoB5pmkblGw1buDYZMhmCeTdROY417o7BJBeYPqgItXgUpOR2LohqVh P1q35NIE29TvGOR1QaNgm+dtVg== X-Received: by 2002:a17:903:2348:b0:186:c372:72d6 with SMTP id c8-20020a170903234800b00186c37272d6mr6220475plh.25.1668553771178; Tue, 15 Nov 2022 15:09:31 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id g3-20020a170902868300b00168dadc7354sm10478322plo.78.2022.11.15.15.09.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Nov 2022 15:09:30 -0800 (PST) Message-ID: <928d9094-db54-7b27-98a6-9ece514f12e1@kernel.dk> Date: Tue, 15 Nov 2022 16:09:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v1 2/2] io_uring: uapi: Don't use a zero-size array To: Ammar Faizi Cc: Pavel Begunkov , Stefan Metzmacher , Linux Kernel Mailing List , io-uring Mailing List , GNU/Weeb Mailing List References: <20221115212614.1308132-1-ammar.faizi@intel.com> <20221115212614.1308132-3-ammar.faizi@intel.com> Content-Language: en-US From: Jens Axboe In-Reply-To: <20221115212614.1308132-3-ammar.faizi@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/15/22 2:29 PM, Ammar Faizi wrote: > From: Ammar Faizi > > 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