On 8/28/2023 12:03 PM, Bruce Richardson wrote: > On Mon, Aug 28, 2023 at 12:42:38PM +0200, Stephen Hemminger wrote: >> For humor >> #define RTE_CASTAWAY(x) ((void *)(uinptr_t)(x)) > > Yes, actually thought about that. Was also wondering about making it an > inline function rather than macro, to ensure its only used on pointers, and > to make clear what is being cast away: > > static inline void * > rte_cast_no_volatile(volatile void *x) > { > return (void *)(uintptr_t)(x); > } >
Not as good, without 'castaway' in the API/macro name :) > and similarly we could do a rte_cast_no_const(const void *x). > > WDYT? > > /Bruce