From 64a2a8e8b8b09cff1ee4830b7f2521bd19474e92 Mon Sep 17 00:00:00 2001 From: zhujiale <945386260@qq.com> Date: Tue, 14 Jan 2025 10:25:52 +0800 Subject: [PATCH] fix cppcheck in lwp.c will fail if no define RT_USING_DFS --- tools/ci/cpp_check.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/ci/cpp_check.py b/tools/ci/cpp_check.py index 8a4e05169ff..7f3ca5a4394 100644 --- a/tools/ci/cpp_check.py +++ b/tools/ci/cpp_check.py @@ -52,6 +52,10 @@ def check(self): logging.info("Start to static code analysis.") check_result = True for file in file_list_filtered: + macros = [] + if os.path.basename(file) == 'lwp.c': + macros.append('-DRT_USING_DFS') + result = subprocess.run( [ 'cppcheck', @@ -70,7 +74,7 @@ def check(self): '--error-exitcode=1', '--force', file - ], + ] + macros, stdout = subprocess.PIPE, stderr = subprocess.PIPE) logging.info(result.stdout.decode()) logging.info(result.stderr.decode())