From: Stephen Hemminger Date: Fri, 8 May 2020 23:25:05 +0000 (-0700) Subject: eal: fix C++17 compilation X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3a2cd6fd069e26410810df6c2ec81d283bb6fbaa;p=dpdk.git eal: fix C++17 compilation Compiling a C++ application that includes directly or indirectly rte_common.h will cause a warning: include/rte_common.h:350:37: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] rte_combine32ms1b(register uint32_t x) C++ is pickier than standard C and flags this antique usage. The register keyword is an old K&R legacy and should be removed everywhere in DPDK. For now, fix it where it hurts. Fixes: 08f683174e94 ("eal: add functions for previous power of 2 alignment") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson --- diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h index 668e8b0af8..0843ce69e7 100644 --- a/lib/librte_eal/include/rte_common.h +++ b/lib/librte_eal/include/rte_common.h @@ -409,7 +409,7 @@ __extension__ typedef uint64_t RTE_MARKER64[0]; * The combined value. */ static inline uint32_t -rte_combine32ms1b(register uint32_t x) +rte_combine32ms1b(uint32_t x) { x |= x >> 1; x |= x >> 2; @@ -431,7 +431,7 @@ rte_combine32ms1b(register uint32_t x) * The combined value. */ static inline uint64_t -rte_combine64ms1b(register uint64_t v) +rte_combine64ms1b(uint64_t v) { v |= v >> 1; v |= v >> 2;