From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by gnuweeb.org (Postfix) with ESMTPS id D9183815D2 for ; Tue, 15 Nov 2022 23:09:31 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=kernel-dk.20210112.gappssmtp.com header.i=@kernel-dk.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=GSETCmmw; dkim-atps=neutral Received: by mail-pj1-f44.google.com with SMTP id k5so14892393pjo.5 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=cponTYXQhVrgtNt88IuWHObUFxEbbgdNfpJeLoKv/X/4hIq9XmcfEfENUbZ3LKPMvH C8hhVtxEA0PKhmGLOXRzR6sDvn4jJpPPHdtar76akQpbCx6ReTWOA7epOkA6novZWao9 wb2en1QyMNE51b8qJqbCNk87Zfs+iIMLEnLkhQI3ZQo1cGBQB2Y/SpVPbzBENLJJYynf pdcWpeICjds9QmMuwYcJ96T3lOnUmkHgFrcJGHLoW+aeEmfvRM6KG1tiwzaBNbestQcF E6mdsSZAhLqCVs/z28kRIMAB+MJStsFKpO8r9UzN2BKE31qNuCa1m3byo3tnHuZi2d9Y WcAw== X-Gm-Message-State: ANoB5plF8NVRus0qOlX9GASRQeU9LVq4tsfwGZgVLG0WlcP98nphIsjn FqnoNtA0D8DZUHR1es6TMptcWg== X-Google-Smtp-Source: AA0mqf5hrzm+u74QOK/MPhyijy1Gq+yHbSRmdLenCJSPLSlcI3lTOa69tFlNv+HXA/9Pa+laoNSPdQ== 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 List-Id: 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