Skip to content
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

Update cppcheck and astyle versions #3037

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

matt335672
Copy link
Member

Bumped astyle and cppcheck to latest versions.

There's an issue with cppcheck which I'd appreciate a comment on. Version 2.13.0 was taking around 20 minutes or so to run. With 2.14.0, I get warnings like this with the same sources:-

common/base64.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

^
common/file.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

^
common/list.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

^
common/log.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]
...

If I use --check-level=exhaustive with 2.14.0, I get check times of around an hour:-

https://github.com/matt335672/xrdp/actions/runs/8781923998/job/24094941025

However, if I just disable the warnings and go with --check-level=normal, I'm getting run times of about 4 minutes, 30 seconds:-

https://github.com/matt335672/xrdp/actions/runs/8782777220/job/24097568007

Neither option seems as good to me, but I've gone for the shorter one. A longer run can still be requested manually.

Any thoughts appreciated.

@firewave
Copy link
Contributor

It is a bit of a mess right now and discussions are ongoing about this.

--check-level=normal disables a whole part of ValueFlow which saw a massive performance regression in 2.14. So going for --check-level=exhaustive will seriously increase your run-time. Also the threshold for normalCheckLevelMaxBranches is currently not configurable and determined inconsistently and exceeded quite easily (https://trac.cppcheck.net/ticket/12508).

So suppressing the messages for now and leaving the --check-level=normal should be the way to go.

@matt335672
Copy link
Member Author

Thanks for the update @firewave. That's an interesting link.

@firewave
Copy link
Contributor

Also please CC me on any future Cppcheck-related things.

Version 2.14.0 of cppcheck generates errors relating to the
check level (e.g.):-

    common/base64.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

This does not happen with the same sources (commit
f781962) under 2.13.0.

This PR disables the warnings above for 2.14.0, but also allows a '-f'
argument to be passed in to request an exhaustive test. This could be used
(for example) before a major release. An exhaustive test takes a *lot*
longer. The first run with a git runner was around an hour.

The --check-level=flag was only added for 2.11.0, and so this now needs
a version check.
@matt335672 matt335672 force-pushed the update_cppcheck branch 3 times, most recently from 5158e34 to 0ec084f Compare May 28, 2024 11:22
@matt335672
Copy link
Member Author

cppcheck version updated to 2.14.1

Check times for both normal and extensive remain unaltered from 2.14.0

@firewave - I'm unsure what the best thing to do here is. Is it likely in later versions of cppcheck that we'll regain more rational behaviour without specifying a check_level? Or should we proceed with a check_level of normal for CI purposes, and keep an option of running an extensive check before releases?

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

Successfully merging this pull request may close these issues.

None yet

2 participants