From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] test-pmd: Fix pointer aliasing error Date: Fri, 05 Dec 2014 10:24:40 +0100 Message-ID: <1711291.egEY51Wr4d@xps13> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: "Qiu, Michael" Return-path: In-Reply-To: <533710CFB86FA344BFBF2D6802E60286C9CFE5-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-12-05 05:34, Qiu, Michael: > Any comments about this version? a new workaround solution :) Yes, one comment: I think it's ugly :) These aliasing errors are not reliable so I think we can disable it (like Linux does). But in case you don't want to disable the warning, please add a comment to your workaround to explain it is caused by GCC strict-aliasing check. > > - const uint16_t *u16 = (const uint16_t *)buf; > > + uintptr_t ptr = (uintptr_t)buf; > > + const uint16_t *u16 = (const uint16_t *)ptr; Thanks -- Thomas