From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by dpdk.org (Postfix) with ESMTP id DDB9C6A87 for ; Thu, 11 Dec 2014 01:54:48 +0100 (CET) Received: by mail-wi0-f169.google.com with SMTP id r20so15017910wiv.0 for ; Wed, 10 Dec 2014 16:54:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=KUb8WdA9NZ9sbB0YKcVuWnG/Ybru2lFJ3X6WKShTG7M=; b=jHY943t5JGNNrxB9jk5rFoOZCuwKhZGXCuuNZbxMHLcUNSIm1G33s64+J/wckmdKUt yGOgmtrp3FN+w1phs2yFHO5RUm7fRr4vAMWmbAeoJMQLy1QlWpalPmRNqmS6w/m0jWZF PGgAofRAE3WRgO+BgjXrn6cB7NoujbiJ8w8qffbPz6KgnV9MMLOFUKec1+bSr197AOCa cIC+y6NfoDQkg3YjZ+kPOatGZEWPf9aFK8hxTXVGjNZH/vqixAf6zBik+TfnBtch1l1U N61jrL+A3zjtEgXy+Q1v0k1ypummO6qJGa6FeAijNJpfn98KHigzH2EXvHflWUHpapAS Tqsw== X-Gm-Message-State: ALoCoQnGVFwyr8/kTVxQ+JiL3W6bpcOFZKb8aExvINhshF3nFeY8kNGAoV0w+Yx5vHGC6y+Leeuf X-Received: by 10.194.92.82 with SMTP id ck18mr11192772wjb.103.1418259288770; Wed, 10 Dec 2014 16:54:48 -0800 (PST) Received: from xps13.localnet ([88.249.222.12]) by mx.google.com with ESMTPSA id h8sm137726wiy.17.2014.12.10.16.54.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Dec 2014 16:54:47 -0800 (PST) From: Thomas Monjalon To: "Qiu, Michael" , dev@dpdk.org Date: Thu, 11 Dec 2014 01:54:21 +0100 Message-ID: <1930269.B5nWyJ5DBl@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.17.4-1-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: <533710CFB86FA344BFBF2D6802E60286C9D683@SHSMSX101.ccr.corp.intel.com> References: <1417663711-19576-1-git-send-email-michael.qiu@intel.com> <1417666564-19950-1-git-send-email-michael.qiu@intel.com> <533710CFB86FA344BFBF2D6802E60286C9D683@SHSMSX101.ccr.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Subject: Re: [dpdk-dev] [PATCH v3] test-pmd: Fix pointer aliasing error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2014 00:54:49 -0000 > > app/test-pmd/csumonly.c: In function =E2=80=98get_psd_sum=E2=80=99:= > > build/include/rte_ip.h:161: error: dereferencing pointer =E2=80=98u= 16=E2=80=99 > > does break strict-aliasing rules > > build/include/rte_ip.h:157: note: initialized from here > > ... > > > > The root cause is that, compile enable strict aliasing by default, > > while in function rte_raw_cksum() try to convert 'const char *' > > to 'const uint16_t *'. > > > > This patch is one workaround fix. > > > > Signed-off-by: Michael Qiu > > --- > > v3 --> v2: > > =09use uintptr_t instead of unsigned long to > > =09save pointer. > > > > v2 --> v1: > > =09Workaround solution instead of shut off the > > =09gcc params. >=20 > This workaround is to solve the compile issue of GCC strict-aliasing(= Two > different type pointers should not be point to the same memory addres= s). >=20 > For GCC 4.4.7 it will definitely occurs if flags "-fstrict-aliasing"= > and "-Wall" used. Acked-by: Thomas Monjalon >=20 Applied with a comment in the code. Thanks --=20 Thomas