From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 78B1B43358; Fri, 17 Nov 2023 21:00:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55FF740285; Fri, 17 Nov 2023 21:00:00 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 510064021E for ; Fri, 17 Nov 2023 20:59:58 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 82BA420B74C0; Fri, 17 Nov 2023 11:59:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 82BA420B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1700251197; bh=DpM/3kNuW/vyFsTPB8RL/85J7h48nTpP/egALebg//Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OfB3wCfOKy5U3+XFPoz/o9xtAjZTZRCXYUMZAMA2cPFd0VORDgvmCaTav6/858VPK yPzFxW5VaU8olijcqN9pxYcCGEm9YMbtXzbBbVe5URG8eJ5jnk36MRQKrK3rX4xaOL XJ28v7GxgwU/KYO1NED7mEch+21J62jRgr3HBfug= Date: Fri, 17 Nov 2023 11:59:57 -0800 From: Tyler Retzlaff To: Stephen Hemminger Cc: Morten =?iso-8859-1?Q?Br=F8rup?= , dev@dpdk.org Subject: Re: [PATCH v2 00/10] replace zero length arrays Message-ID: <20231117195957.GA30527@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20230113215205.125767-1-stephen@networkplumber.org> <20231117040432.131737-1-stephen@networkplumber.org> <98CBD80474FA8B44BF855DF32C47DC35E9F037@smartserver.smartshare.dk> <20231117081823.15f63580@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231117081823.15f63580@hermes.local> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, Nov 17, 2023 at 08:18:23AM -0800, Stephen Hemminger wrote: > On Fri, 17 Nov 2023 09:31:11 +0100 > Morten Brørup wrote: > > > Series-acked-by: Morten Brørup > > > > Suggest checkpatches to disallow this, if it doesn't already. > > Unfortunately, matching this with awk is too hard. Coccinelle can do it > but don't want to introduce dependency on that. > > Maybe a compiler flag would be possible, but could not find one. -pedantic will warn, but to use it without clobbering the build with warnings we would probably need to qualify all use of non-standard extensions with the __extension__ keyword. ``` struct foo { int a; int b; char buffer[0]; }; ``` zhora ~> gcc -Wall -pedantic oink.c oink.c:7:14: warning: ISO C forbids zero-size array ‘buffer’ [-Wpedantic] 7 | char buffer[0];