From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2EF76CE7 for ; Mon, 8 Dec 2014 02:30:47 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 07 Dec 2014 17:28:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="495172795" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga003.jf.intel.com with ESMTP; 07 Dec 2014 17:27:09 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 8 Dec 2014 09:28:08 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.182]) with mapi id 14.03.0195.001; Mon, 8 Dec 2014 09:28:08 +0800 From: "Qiu, Michael" To: Thomas Monjalon Thread-Topic: [PATCH v3] test-pmd: Fix pointer aliasing error Thread-Index: AQHQD8cg6//kKikCHUuP3ggaMBczHg== Date: Mon, 8 Dec 2014 01:28:07 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286C9D678@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> <533710CFB86FA344BFBF2D6802E60286C9CFE5@SHSMSX101.ccr.corp.intel.com> <1711291.egEY51Wr4d@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" 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: Mon, 08 Dec 2014 01:30:47 -0000 On 12/5/2014 5:26 PM, Thomas Monjalon wrote:=0A= > 2014-12-05 05:34, Qiu, Michael:=0A= >> Any comments about this version? a new workaround solution :)=0A= > Yes, one comment: I think it's ugly :)=0A= > These aliasing errors are not reliable so I think we can disable it (like= =0A= > Linux does).=0A= > But in case you don't want to disable the warning, please add a comment t= o your=0A= > workaround to explain it is caused by GCC strict-aliasing check.=0A= =0A= Yes, really ugly ....=0A= =0A= But lots of reviewer voted against with disable it as my first version=0A= is disable.=0A= =0A= I could not think out a better solution for all reviewers can accept.=0A= =0A= I will add the comment with the thread of v3 patch.=0A= =0A= Thanks,=0A= Michael=0A= =0A= >>> - const uint16_t *u16 =3D (const uint16_t *)buf;=0A= >>> + uintptr_t ptr =3D (uintptr_t)buf;=0A= >>> + const uint16_t *u16 =3D (const uint16_t *)ptr;=0A= =0A= > Thanks=0A= =0A=