From patchwork Fri Oct 16 22:31:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 531575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 5585814110C for ; Sat, 17 Oct 2015 09:32:10 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 68E1D22C383; Fri, 16 Oct 2015 15:32:09 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 2444022C382 for ; Fri, 16 Oct 2015 15:32:08 -0700 (PDT) Received: from bar4.cudamail.com (bar2 [192.168.15.2]) by mx3v1.cudamail.com (Postfix) with ESMTP id 7B145618247 for ; Fri, 16 Oct 2015 16:32:07 -0600 (MDT) X-ASG-Debug-ID: 1445034726-03dc210f947f590001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar4.cudamail.com with ESMTP id QMCxO8SexCxnvAx4 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 16 Oct 2015 16:32:06 -0600 (MDT) X-Barracuda-Envelope-From: joestringer@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mail-pa0-f42.google.com) (209.85.220.42) by mx3-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 16 Oct 2015 22:32:05 -0000 Received-SPF: unknown (mx3-pf2.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.42 Received: by payp3 with SMTP id p3so1118110pay.2 for ; Fri, 16 Oct 2015 15:32:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=5+6w0WoB6BDboKU0ZhK2X1NPBfCNb/ennCDqSoO5VdY=; b=BfSHPdfpIGs75HScaCTCsBksE8G4LBTokYoHPx7yCZ3dbtm91Y3HGqlqgOqAqxDSYX O0N1hmH/11qr5i0R2p4jFahP704wIpglM/8qR7z2sxjKs1ew/9hT7/jwZ/3yo0QqswpG /wkI4trtrdID2H7lFcU+ceciteHApMycc+oB6AuwKCEzrgFH0jsd/9QdHKeJCuKus6fj +oWFI5SsUULQUwXf7zd2Gts//O8A9OUug/OHITJpDHD+yEiYR0PSbvRyPa4JUr+c++Yd tL0XqfdwGKwedsb6jxNsQ6zHoqNE0LTdfZ6YwTHWAD2XbU/ed8d71fPmPXRbYwZow/bP QjZw== X-Gm-Message-State: ALoCoQnfIlJjfQxj3boMKexNfkWqHa2HpND2WV9UV6KfIcr2QOOsEfpHV0wWcwOd7FwUsIYfo0vf X-Received: by 10.68.173.130 with SMTP id bk2mr19357978pbc.169.1445034725837; Fri, 16 Oct 2015 15:32:05 -0700 (PDT) Received: from localhost.localdomain ([208.91.2.4]) by smtp.gmail.com with ESMTPSA id cx5sm531853pbc.50.2015.10.16.15.32.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Oct 2015 15:32:05 -0700 (PDT) X-CudaMail-Envelope-Sender: joestringer@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.2.4 From: Joe Stringer To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V2-1015065902 X-CudaMail-DTE: 101615 X-CudaMail-Originating-IP: 209.85.220.42 Date: Fri, 16 Oct 2015 15:31:59 -0700 X-ASG-Orig-Subj: [##CM-V2-1015065902##][PATCH] ofp-actions: Fix build on earlier GCC. Message-Id: <1445034719-59328-1-git-send-email-joestringer@nicira.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1445034726 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH] ofp-actions: Fix build on earlier GCC. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" GCC4.4 gets confused by anonymous fields + flexible fields, complains: lib/ofp-actions.h:510: error: flexible array member in otherwise empty struct lib/ofp-actions.h:512: error: bit-field ‘build_assert_failed’ width not an integer constant lib/ofp-actions.h:514: error: bit-field ‘build_assert_failed’ width not an integer constant Fix the problem by specifying the actions length as zero. Reported-by: Pravin B Shelar Signed-off-by: Joe Stringer Acked-by: Pravin B Shelar --- Tested manually on RHEL6.6, and via AppVeyor and Travis CI. Everything seems happy. --- lib/ofp-actions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h index 0ad2e3f9f26f..773b6170474d 100644 --- a/lib/ofp-actions.h +++ b/lib/ofp-actions.h @@ -507,7 +507,7 @@ struct ofpact_conntrack { CT_MEMBERS; uint8_t pad[OFPACT_ALIGN(sizeof(CT_MEMBERS))]; }; - struct ofpact actions[]; + struct ofpact actions[0]; }; BUILD_ASSERT_DECL(offsetof(struct ofpact_conntrack, actions) % OFPACT_ALIGNTO == 0);