4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-30 04:10:26 +08:00

fix cppcheck in lwp.c will fail if no define RT_USING_DFS (#9912)

This commit is contained in:
zhuzhuzhu 2025-01-14 14:21:04 +08:00 committed by GitHub
parent 4343d32df4
commit 4e370473c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,6 +52,10 @@ class CPPCheck:
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 @@ class CPPCheck:
'--error-exitcode=1',
'--force',
file
],
] + macros,
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
logging.info(result.stdout.decode())
logging.info(result.stderr.decode())