[PATCH] support: Define support_static_assert for use from C and C++

Paul Eggert eggert@cs.ucla.edu
Sun Dec 31 20:25:00 GMT 2017


Florian Weimer wrote:
> +/* Static assertion, under a common name for both C++ and C11.  */
> +#ifdef __cplusplus
> +# define support_static_assert static_assert
> +#else
> +# define support_static_assert _Static_assert
> +#endif

Wouldn't it be simpler to do this?

#ifdef __cplusplus
# define _Static_assert static_assert
#endif

and then use _Static_assert everywhere? Or do it the other way around. It seems 
odd to introduce yet another name "support_static_assert" for this concept.



More information about the Libc-alpha mailing list