[dpdk-dev] [PATCH] eal: standard c++ forbids defining the keyword asm as a macro
Thomas Monjalon
thomas at monjalon.net
Tue Apr 13 15:35:53 CEST 2021
24/03/2021 05:26, Tyler Retzlaff:
> --- a/lib/librte_eal/include/rte_common.h
> +++ b/lib/librte_eal/include/rte_common.h
> @@ -31,9 +31,11 @@ extern "C" {
> #define typeof __typeof__
> #endif
>
> +#ifndef __cplusplus
> #ifndef asm
> #define asm __asm__
> #endif
> +#endif
Applied with this explanation:
eal: do not redefine asm keyword in C++
C++ forbids redefining a keyword as a macro.
The keyword asm is conditionally-supported and implementation defined,
but it seems our best guess.
In C, if asm does not exist, it is defined as __asm__
which is a GNU extension.
One more question:
Can we have a similar issue with typeof?
I guess it works because typeof is not a keyword?
More information about the dev
mailing list