Re: [dpdk-dev] [PATCH 1/6] eal: add portable way to check for math overflow

2020-03-03 Thread Dmitry Kozlyuk
> +#if defined(__has_builtin) > +#if __has_builtin(__builtin_add_overflow) > +#define RTE_HAVE_BUILTIN_OVERFLOW > +#endif > +#elif defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 5000) > +#define RTE__HAVE_BUILTIN_OVERFLOW Excessive underline after RTE results in RTE_HAVE_BUILTIN

[dpdk-dev] [PATCH 1/6] eal: add portable way to check for math overflow

2020-03-03 Thread Stephen Hemminger
Clang and recent versions of GCC has builtin functions to do most math operations and check for wraparound. On most architectures this is a just a math operation followed by a branch on carry set. But DPDK needs to be able to handle older GCC versions, and other compilers so a wrapper macro is nee