From patchwork Tue Sep 22 19:53:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin Serdean X-Patchwork-Id: 521395 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 AE4781401AD for ; Wed, 23 Sep 2015 05:55:10 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 8B8C310976; Tue, 22 Sep 2015 12:55:08 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 3027A10971 for ; Tue, 22 Sep 2015 12:55:07 -0700 (PDT) Received: from bar2.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 96F5F1E0256 for ; Tue, 22 Sep 2015 13:55:06 -0600 (MDT) X-ASG-Debug-ID: 1442951705-03dc537fe24a41e0001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar2.cudamail.com with ESMTP id dvjXYJ7dXymIxuOB (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Sep 2015 13:55:06 -0600 (MDT) X-Barracuda-Envelope-From: aserdean@cloudbasesolutions.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO cbssmtp1.cloudbase.local) (91.232.152.5) by mx1-pf2.cudamail.com with SMTP; 22 Sep 2015 19:55:05 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at cloudbasesolutions.com designates 91.232.152.5 as permitted sender) X-Barracuda-Apparent-Source-IP: 91.232.152.5 X-Barracuda-RBL-IP: 91.232.152.5 Received: from localhost (localhost [127.0.0.1]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id 9FDDC425DC for ; Tue, 22 Sep 2015 22:55:04 +0300 (EEST) X-Virus-Scanned: amavisd-new at cloudbasesolutions.com Received: from cbssmtp1.cloudbase.local ([127.0.0.1]) by localhost (cbssmtp1.cloudbase.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QWyMnOo-26bC for ; Tue, 22 Sep 2015 22:54:44 +0300 (EEST) Received: from CBSEX1.cloudbase.local (unknown [10.77.78.3]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id 470244221C for ; Tue, 22 Sep 2015 22:53:31 +0300 (EEST) Received: from CBSEX1.cloudbase.local ([10.77.78.3]) by CBSEX1.cloudbase.local ([10.77.78.3]) with mapi id 14.03.0224.002; Tue, 22 Sep 2015 21:53:31 +0200 X-CudaMail-Envelope-Sender: aserdean@cloudbasesolutions.com From: Alin Serdean To: "dev@openvswitch.org" X-CudaMail-MID: CM-E2-921083027 X-CudaMail-DTE: 092215 X-CudaMail-Originating-IP: 91.232.152.5 Thread-Topic: [PATCH 2/7] MSVC 64 bit compile error X-ASG-Orig-Subj: [##CM-E2-921083027##][PATCH 2/7] MSVC 64 bit compile error Thread-Index: AQHQ9XBbCoBrCNW3TE+NP8Mn3GlG+Q== Date: Tue, 22 Sep 2015 19:53:30 +0000 Message-ID: <1442951618-13080-3-git-send-email-aserdean@cloudbasesolutions.com> References: <1442951618-13080-1-git-send-email-aserdean@cloudbasesolutions.com> In-Reply-To: <1442951618-13080-1-git-send-email-aserdean@cloudbasesolutions.com> Accept-Language: en-US, it-IT Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.78.1] MIME-Version: 1.0 X-GBUdb-Analysis: 0, 91.232.152.5, Ugly c=0.279065 p=-0.466667 Source Normal X-MessageSniffer-Rules: 0-0-0-4921-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1442951706 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.22796 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Subject: [ovs-dev] [PATCH 2/7] MSVC 64 bit compile error 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" MSVC does not support zero-size array unless it is the last member of a defined structure. The error is hit only on MSVC 64 bit because the size of uint64_t is equal with sizeof(struct tun_table *). This patch ifdef's out the pad member of the structure tun_metadata in case we are on the MSVC 64 bit compiler. Signed-off-by: Alin Gabriel Serdean --- lib/tun-metadata.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tun-metadata.h b/lib/tun-metadata.h index 624c881..801ed13 100644 --- a/lib/tun-metadata.h +++ b/lib/tun-metadata.h @@ -36,6 +36,7 @@ struct tun_table; #define TUN_METADATA_NUM_OPTS 64 #define TUN_METADATA_TOT_OPT_SIZE 256 + /* Tunnel option data, plus metadata to aid in their interpretation. * * The option data exists in two forms and is interpreted differently depending @@ -63,7 +64,9 @@ struct tun_metadata { uint8_t len; /* Length of data in 'opts'. */ } present; struct tun_table *tab; /* Types & lengths for 'opts' and 'opt_map'. */ +#ifndef _WIN64 uint8_t pad[sizeof(uint64_t) - sizeof(struct tun_table *)]; /* Make 8 bytes */ +#endif union { uint8_t u8[TUN_METADATA_TOT_OPT_SIZE]; /* Values from tunnel TLVs. */ struct geneve_opt gnv[GENEVE_TOT_OPT_SIZE / sizeof(struct geneve_opt)];