Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E2EEC433E2 for ; Tue, 9 Jun 2020 13:27:08 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CAC220774 for ; Tue, 9 Jun 2020 13:27:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CAC220774 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jieHH-0008WE-5O; Tue, 09 Jun 2020 13:26:55 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jieHF-0008W9-9Q for xen-devel@lists.xenproject.org; Tue, 09 Jun 2020 13:26:53 +0000 X-Inumbo-ID: e136ae30-aa54-11ea-b31f-12813bfff9fa Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e136ae30-aa54-11ea-b31f-12813bfff9fa; Tue, 09 Jun 2020 13:26:52 +0000 (UTC) Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: LCT9xGyJWNUMkOsK8scVAC77zhZRyjblAyL9jMY2o4zI81gawD1L3V8kTms5PFmbSoN/SsSdFv 96jyIzKnoMJEhHaPebl5vxcOgN2TDgW+jP9tIFBwmYpS35s81jnLMFWOi1oGl/NePHdD8VMjbi 40KhR7dCPaILve+pVezZpIIGckKIcTaBd2VxJB5GraGllQ0DPFv9moWmdstYmb8PwgmgTqFJCx roHV+Huc0lI9zDLT+A0nIJ0nLNrGOTtinCTPSNsexzBW0KihuOT+o8+bnRy6shJ07KJMudWBEX 5Fg= X-SBRS: 2.7 X-MesageID: 19573899 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,492,1583211600"; d="scan'208";a="19573899" From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <24287.36374.917457.787627@mariner.uk.xensource.com> Date: Tue, 9 Jun 2020 14:26:46 +0100 To: Olaf Hering Subject: Re: [PATCH v1] kdd: remove zero-length arrays In-Reply-To: <20200609152233.039cfc86.olaf@aepfle.de> References: <20200608203849.18341-1-olaf@aepfle.de> <005001d63e3b$c85059f0$58f10dd0$@xen.org> <20200609121549.GA90841@deinos.phlegethon.org> <20200609152233.039cfc86.olaf@aepfle.de> X-Mailer: VM 8.2.0b under 24.5.1 (i686-pc-linux-gnu) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: xen-devel@lists.xenproject.org, Tim Deegan , 'Ian Jackson' , 'Wei Liu' , paul@xen.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Olaf Hering writes ("Re: [PATCH v1] kdd: remove zero-length arrays"): > Am Tue, 9 Jun 2020 13:15:49 +0100 > schrieb Tim Deegan : > > > Olaf, can you try dropping the 'payload' field from the header and replacing the payload[0] in pkt with payload[] ? > > In file included from kdd.c:53: > kdd.h:325:17: error: flexible array member in union > 325 | uint8_t payload[]; ... > kdd_stc stc; > - uint8_t payload[0]; > + uint8_t payload[]; > }; > } PACKED kdd_pkt; Try > kdd_stc stc; > - uint8_t payload[0]; > }; + uint8_t payload[]; > } PACKED kdd_pkt; ? (I haven't read the surrounding code...) Ian.