[dpdk-dev] [RFC] toolchain specific macro expansion

Thomas Monjalon thomas at monjalon.net
Thu Jun 24 18:29:20 CEST 2021


24/06/2021 18:02, Tyler Retzlaff:
> On Thu, Jun 24, 2021 at 08:54:49AM +0200, Thomas Monjalon wrote:
> > 23/06/2021 20:26, Tyler Retzlaff:
> > > // lib/eal/gcc/rte_toolchain_common.h
> > > #define __rte_noreturn __attribute__((noreturn))
> > 
> > We should keep a macro in rte_common.h which triggers an explicit error
> 
> i think that's relatively trivial to do. rte_common.h could after
> toolchain specific include do a simple test.
> 
> #ifndef __rte_no_return
> #error no __rte_no_return defined for toolchain
> #endif

No I was thinking of:

/** Doxygen comment for the attribute below */
#define __rte_no_return RTE_ATTR_NOT_SUPPORTED

This way we have a documentation in a single place for the macro,
and compilation fails if it is not implemented for the toolchain.




More information about the dev mailing list