From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] eal: fix type of pointer arithmetic result Date: Fri, 26 Jul 2013 15:21:48 +0200 Message-ID: <201307261521.48620.thomas.monjalon@6wind.com> References: <1374838440-21429-1-git-send-email-thomas.monjalon@6wind.com> <20130726121244.GK7849@6wind.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Adrien Mazarguil Return-path: In-Reply-To: <20130726121244.GK7849-pdR9zngts4EAvxtiuMwx3w@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" 26/07/2013 14:12, Adrien Mazarguil : > On Fri, Jul 26, 2013 at 01:34:00PM +0200, Thomas Monjalon wrote: > > Adding or subtracting a value to a pointer makes a new pointer > > of unknown type. > > So typeof() is replaced by (void*) in RTE_PTR_ADD() and RTE_PTR_SUB(). > > > > But RTE_PTR_ALIGN_* macros have in their explicit API to return a pointer > > of the same type. Since RTE_PTR_ALIGN_CEIL is based on RTE_PTR_ADD, a > > typeof() is added to keep the original behaviour. > > > > Signed-off-by: Thomas Monjalon > > --- > > > > lib/librte_eal/common/include/rte_common.h | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > Acked-by: Adrien Mazarguil pushed -- Thomas