mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-12-10 08:46:40 +08:00
[PATCH] debug: Add braces around empty body in an 'if' statement
I have below code in my cc.h:
#ifdef MYSDK_LWIP_DEBUG
#define LWIP_PLATFORM_ASSERT(x) MYSDK_ASSERTION_FAIL_ACTION()
#else
#define LWIP_PLATFORM_ASSERT(x)
#endif /* ifdef MYSDK_LWIP_DEBUG */
I got below error when in non-debug build:
src/include/lwip/debug.h:76:32: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
LWIP_PLATFORM_ASSERT(message); } while(0)
^
Fix the build error by adding braces around empty body in an 'if' statement.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: sg <goldsimon@gmx.de>
This commit is contained in:
parent
5c0944e01a
commit
18fcc1d504
@ -72,8 +72,8 @@
|
|||||||
* -- To disable assertions define LWIP_NOASSERT in arch/cc.h.
|
* -- To disable assertions define LWIP_NOASSERT in arch/cc.h.
|
||||||
*/
|
*/
|
||||||
#ifndef LWIP_NOASSERT
|
#ifndef LWIP_NOASSERT
|
||||||
#define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \
|
#define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \
|
||||||
LWIP_PLATFORM_ASSERT(message); } while(0)
|
LWIP_PLATFORM_ASSERT(message); }} while(0)
|
||||||
#ifndef LWIP_PLATFORM_ASSERT
|
#ifndef LWIP_PLATFORM_ASSERT
|
||||||
#error "If you want to use LWIP_ASSERT, LWIP_PLATFORM_ASSERT(message) needs to be defined in your arch/cc.h"
|
#error "If you want to use LWIP_ASSERT, LWIP_PLATFORM_ASSERT(message) needs to be defined in your arch/cc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user