mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
core/compiler_hints: add may_be_zero()
This commit is contained in:
parent
4c27aff295
commit
0ee46e8d42
@ -181,6 +181,19 @@ extern "C" {
|
|||||||
#define assume(cond) assert(cond)
|
#define assume(cond) assert(cond)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Wrapper function to silence "comparison is always false due to limited
|
||||||
|
* range of data type" type of warning when the warning is caused by a
|
||||||
|
* preprocessor configuration value that may be zero.
|
||||||
|
*
|
||||||
|
* @param[in] n Variable that may be zero
|
||||||
|
* @return The same variable @p n
|
||||||
|
*/
|
||||||
|
static inline unsigned may_be_zero(unsigned n)
|
||||||
|
{
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user