> From: Dmitry Kozlyuk [mailto:dmitry.kozl...@gmail.com]
> Sent: Sunday, 21 August 2022 22.50
>
> RTE_PTR_SUB(ptr, x) and RTE_PTR_ALIGN_FLOOR() worked incorrectly
> if "ptr" was an expression:
>
> uint32_t arr[3];
>
> RTE_PTR_SUB(arr + 1, sizeof(arr[0]));
> // expected: (uint32_t *)(
RTE_PTR_SUB(ptr, x) and RTE_PTR_ALIGN_FLOOR() worked incorrectly
if "ptr" was an expression:
uint32_t arr[3];
RTE_PTR_SUB(arr + 1, sizeof(arr[0]));
// expected: (uint32_t *)((uintptr_t)(arr + 1) - 4) == arr
// actual: (uint32_t *)((uintptr_t) arr + 1 - 4) != arr
RTE_PTR_AL
2 matches
Mail list logo