fix: suppress unused warnings when DEBUG disabled
When RT_USING_DEBUG is disabled, variables used only in RT_ASSERT statements become unused, triggering -Wunused-but-set-variable compiler warnings. These variables are essential for runtime assertions in debug builds but appear unused in release builds. Example: - Variables used in RT_ASSERT(var != RT_NULL) checks - Affects multiple drivers and components using RT_ASSERT This is a general cleanup to improve code compilation without affecting functionality.
This commit is contained in:
parent
ee1490736c
commit
6b7f1177de
|
@ -117,7 +117,7 @@ extern "C" {
|
||||||
|
|
||||||
/* Common Utilities */
|
/* Common Utilities */
|
||||||
|
|
||||||
#define RT_UNUSED(x) ((void)x)
|
#define RT_UNUSED(x) ((void)(x))
|
||||||
|
|
||||||
/* compile time assertion */
|
/* compile time assertion */
|
||||||
#define RT_STATIC_ASSERT(name, expn) typedef char _static_assert_##name[(expn)?1:-1]
|
#define RT_STATIC_ASSERT(name, expn) typedef char _static_assert_##name[(expn)?1:-1]
|
||||||
|
|
|
@ -804,7 +804,7 @@ if (!(EX)) \
|
||||||
rt_assert_handler(#EX, __FUNCTION__, __LINE__); \
|
rt_assert_handler(#EX, __FUNCTION__, __LINE__); \
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define RT_ASSERT(EX)
|
#define RT_ASSERT(EX) {RT_UNUSED(EX);}
|
||||||
#endif /* RT_DEBUGING_ASSERT */
|
#endif /* RT_DEBUGING_ASSERT */
|
||||||
|
|
||||||
#ifdef RT_DEBUGING_CONTEXT
|
#ifdef RT_DEBUGING_CONTEXT
|
||||||
|
|
Loading…
Reference in New Issue