mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-16 23:40:13 +08:00
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:
@@ -117,7 +117,7 @@ extern "C" {
|
||||
|
||||
/* Common Utilities */
|
||||
|
||||
#define RT_UNUSED(x) ((void)x)
|
||||
#define RT_UNUSED(x) ((void)(x))
|
||||
|
||||
/* compile time assertion */
|
||||
#define RT_STATIC_ASSERT(name, expn) typedef char _static_assert_##name[(expn)?1:-1]
|
||||
|
Reference in New Issue
Block a user