Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7524997rwb; Tue, 15 Nov 2022 13:45:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf4y7bGHsmDUYCU536OxpWFeqR7gcoq1PynZlu3nh4OrBqgZjd1nfesuWcIzkEmGUWkGlX8m X-Received: by 2002:a05:6402:378c:b0:463:ab06:f338 with SMTP id et12-20020a056402378c00b00463ab06f338mr16707108edb.371.1668548704877; Tue, 15 Nov 2022 13:45:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668548704; cv=none; d=google.com; s=arc-20160816; b=Bnf51DPt0PR4SwLCVyfWEmaIYXdkovDxCfG8KqSAgZ/W0LK0OLC0EY3XMFHdtGZY9W xDBBLqcgOE8gySIALjX8CK7PEE0JzS9tyhWsKLJXdnzcAjFu66r3A7ty14uXtuZbzebf gociJogRiaKM9sy05+hEjMrXrHs4sPhR2Va+QQ1U6Pjcr/14bBUSQFacr+yP09V30EgJ MjHzZ3JxSKxLJsFOwG7IRTCCVecE1JHOiD2E/F9V1ah4GRcGEeq1Ig04621MjYShKdaz 4QIc9kbZ9MymNCeHyyDK5bDK2TuGSlayVmeB7JKtHzaHmmIFuWcxyS4tz9VPFDy2U9hF sllQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RcFDsQ40OWceGsVKJjUwqyqFduUTCY3gyU5wVUH2USQ=; b=RqvXaJApXQzDXMkkkifmJJhp+Bw6AveQ/XvZZ45iIJAMEBYIYf4FOv8+qA6CPNYYiM XTNzkO+DNexKv2t1d+/cnM7JtSBneVLG48lz9YHeAs492iwXWX4+oqjgEBsMgXf5+a0+ lvwac7nkwqV86KkVncTFHKk/UFnfZsLKrviY+Jp8ZzZRHhrbzsMmmFXOikX+wgF211gV xOYzwc+h6vFE5DvNza+u8JaJTXoHrmnRoUzSyyIZEl0755yJK58XckcmfBca6rwPNuq4 p/hQ22jv7wCzEqSTbgoYN+ufm5K1ZNmnOcQsZovU5Mz7eeCS1HBN3z42r/hYsbLGRqbC M1Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=O5OIZror; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho33-20020a1709070ea100b007af1002db2bsi5338810ejc.641.2022.11.15.13.44.37; Tue, 15 Nov 2022 13:45:04 -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=@gnuweeb.org header.s=default header.b=O5OIZror; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238812AbiKOVbB (ORCPT + 90 others); Tue, 15 Nov 2022 16:31:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238744AbiKOVar (ORCPT ); Tue, 15 Nov 2022 16:30:47 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A733225CD; Tue, 15 Nov 2022 13:30:46 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.117]) by gnuweeb.org (Postfix) with ESMTPSA id 7DA30815D2; Tue, 15 Nov 2022 21:30:43 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1668547846; bh=26iFCX8cR32AVALAdkE5K60JTO8wkkvkeG+T6XtVZcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5OIZror9lxmQ7YS0bjnNs3GN98mD/owZAWYxhcSH+pLXileUTQEdPJv8b09xSyNH qhg7GWQyDjJ5YdM4Bq8CXLsV/Ud0mXPOCG5sFLc8WjVIqiDjxX7StphFkfbo6sDqgy iEmJVC5vFOMIjGErHbTTCMaBWFFxZ5XyLrVRDyESlSdutijRl1lPpzAlVyYdLfkGHq 30WxwY2B9DSZHnSzjdh/TWKzCvg5YD3S6/BHQn0XGCeuQlQEW6s6mo658SMk/nHCva ZKrVCf930bEg8sko6YtSeZC0+7naGRB0Kj3ENe9mLvH31ciPdwh3RhznanGN8rdBmq wUo59XC2yCPXQ== From: Ammar Faizi To: Jens Axboe Cc: Pavel Begunkov , Stefan Metzmacher , Linux Kernel Mailing List , io-uring Mailing List , GNU/Weeb Mailing List , Ammar Faizi Subject: [PATCH v1 2/2] io_uring: uapi: Don't use a zero-size array Date: Wed, 16 Nov 2022 04:29:53 +0700 Message-Id: <20221115212614.1308132-3-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221115212614.1308132-1-ammar.faizi@intel.com> References: <20221115212614.1308132-1-ammar.faizi@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 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 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. Signed-off-by: Ammar Faizi --- include/uapi/linux/io_uring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index 77027cbaf786..0890784fcc9e 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -85,25 +85,25 @@ struct io_uring_sqe { __u16 __pad3[1]; }; }; union { struct { __u64 addr3; __u64 __pad2[1]; }; /* * If the ring is initialized with IORING_SETUP_SQE128, then * this field is used for 80 bytes of arbitrary command data */ - __u8 cmd[0]; + __u8 cmd[1]; }; }; /* * If sqe->file_index is set to this for opcodes that instantiate a new * direct descriptor (like openat/openat2/accept), then io_uring will allocate * an available direct descriptor instead of having the application pass one * in. The picked direct descriptor will be returned in cqe->res, or -ENFILE * if the space is full. */ #define IORING_FILE_INDEX_ALLOC (~0U) @@ -599,25 +599,25 @@ struct io_uring_buf { struct io_uring_buf_ring { union { /* * To avoid spilling into more pages than we need to, the * ring tail is overlaid with the io_uring_buf->resv field. */ struct { __u64 resv1; __u32 resv2; __u16 resv3; __u16 tail; }; - struct io_uring_buf bufs[0]; + struct io_uring_buf bufs[1]; }; }; /* argument for IORING_(UN)REGISTER_PBUF_RING */ struct io_uring_buf_reg { __u64 ring_addr; __u32 ring_entries; __u16 bgid; __u16 pad; __u64 resv[3]; }; -- Ammar Faizi