1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

core/kernel_defines.h: drop BUILD_BUG_ON()

This provides the same functionality as `static_assert()` provided by
C11 and has no advantages compared to it. Hence, encourage users to use
standard C functionality instead.
This commit is contained in:
Marian Buschsieweke 2021-11-25 09:46:57 +01:00
parent 674fca2023
commit 8608104fe5
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -132,18 +132,6 @@ extern "C" {
#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
#endif
/**
* @def BUILD_BUG_ON(condition)
* @brief Forces a compilation error if condition is true.
* This trick is only needed if the condition can't be evaluated
* before compile time (i.e. sizeof(sometype_t) < 42 )
* For more details on this see for example:
* https://git.kernel.org/pub/scm/linux/kernel/git/stable/
* linux-stable.git/tree/include/linux/bug.h
* @param[in] condition A condition that will be evaluated at compile time
*/
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2 * !!(condition)]))
/**
* @def IS_ACTIVE(macro)
* @brief Allows to verify a macro definition outside the preprocessor.