[dpdk-dev] [PATCH] eal: fix type of pointer arithmetic result

2013-07-26 Thread Thomas Monjalon
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_* mac

[dpdk-dev] [PATCH] eal: fix type of pointer arithmetic result

2013-07-26 Thread 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 pointe

[dpdk-dev] [PATCH] eal: fix type of pointer arithmetic result

2013-07-26 Thread Thomas Monjalon
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 typ