Skip to content

[Bug] Should fix the checking error in ci for rt-smart building. #9906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BernardXiong opened this issue Jan 12, 2025 · 4 comments
Closed

[Bug] Should fix the checking error in ci for rt-smart building. #9906

BernardXiong opened this issue Jan 12, 2025 · 4 comments

Comments

@BernardXiong
Copy link
Member

RT-Thread Version

c5a79de

Hardware Type/Architectures

generic

Develop Toolchain

GCC

Describe the bug

当前在ci中使用cppcheck检查时,如开启了smart,可能会报未使能dfs的错误(因为rt-smart强制关联了dfs),需要确保在cppcheck状态下也能通过。

例如这里的错误:
https://github.com./RT-Thread/rt-thread/actions/runs/12673562082/job/35320219895?pr=9818

Other additional context

No response

@BernardXiong
Copy link
Member Author

@zhuzhuzhus please fix this issue, thanks.

@supperthomas
Copy link
Member

这个error其实不需要修改,本质上是cppcheck没有检测到该宏导致的,
如果要强行给cppcheck加该宏的话,可以在下面的文件中添加

check_result = True
for file in file_list_filtered:
result = subprocess.run(
[
'cppcheck',
'-DRT_ASSERT(x)=',
'-DRTM_EXPORT(x)=',
'-Drt_list_for_each_entry(a,b,c)=a=(void*)b;',
'-I include',
'-I thread/components/finsh',
# it's okay because CI will do the real compilation to check this
'--suppress=syntaxError',
'--check-level=exhaustive',
'--enable=warning',
'performance',
'portability',
'--inline-suppr',
'--error-exitcode=1',
'--force',
file

@zhuzhuzhus
Copy link
Contributor

这个error其实不需要修改,本质上是cppcheck没有检测到该宏导致的, 如果要强行给cppcheck加该宏的话,可以在下面的文件中添加

check_result = True
for file in file_list_filtered:
result = subprocess.run(
[
'cppcheck',
'-DRT_ASSERT(x)=',
'-DRTM_EXPORT(x)=',
'-Drt_list_for_each_entry(a,b,c)=a=(void*)b;',
'-I include',
'-I thread/components/finsh',
# it's okay because CI will do the real compilation to check this
'--suppress=syntaxError',
'--check-level=exhaustive',
'--enable=warning',
'performance',
'portability',
'--inline-suppr',
'--error-exitcode=1',
'--force',
file

加个对lwp.c 的判断应该就行了吧:

    macros = []
    if os.path.basename(file) == 'lwp.c':
        macros.append('-DRT_USING_DFS')  

    result = subprocess.run(
        [
            'cppcheck',
            '-DRT_ASSERT(x)=',
            '-DRTM_EXPORT(x)=',
            '-Drt_list_for_each_entry(a,b,c)=a=(void*)b;',
            '-I include',
            '-I thread/components/finsh',
            '--suppress=syntaxError',
            '--check-level=exhaustive',
            '--enable=warning',
            'performance',
            'portability',
            '--inline-suppr',
            '--error-exitcode=1',
            '--force',
            file
        ] + macros, 

@BernardXiong
Copy link
Member Author

fixed with #9912

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants