Skip to content

Fix #14854 (import project: Handle forced include files from compilation database projects)#8641

Open
JonnyPtn wants to merge 1 commit into
cppcheck-opensource:mainfrom
JonnyPtn:force_includes
Open

Fix #14854 (import project: Handle forced include files from compilation database projects)#8641
JonnyPtn wants to merge 1 commit into
cppcheck-opensource:mainfrom
JonnyPtn:force_includes

Conversation

@JonnyPtn

Copy link
Copy Markdown

Sorry, I don't have access to the bug tracker so haven't been able to log an issue, but hoping it's simple enough

The problem is that if a project uses forced includes cppcheck does not process these when running via a compilation database which can cause errors.

I appreciate it's possible to workaround using cppchecks --include argument, but that means maintaining the force includes in multiple places, and can easily get out of sync with the actual project setup. There may also be file or config specific settings

This change parses those arguments from the project and respects them, with an accompanying test

@danmar danmar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

I created https://trac.cppcheck.net/ticket/14854

Can you please change the PR title to:
Fix #14854 (import project: Handle forced include files from compilation database projects)

@danmar

danmar commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

after the merge.. we should make sure your name is in the AUTHORS file. Which name do you want that we write there?

@JonnyPtn JonnyPtn changed the title Handle forced include files from compilation database projects Fix #14854 (import project: Handle forced include files from compilation database projects) Jun 17, 2026
@JonnyPtn

Copy link
Copy Markdown
Author

Thanks - Updated the title, and you can use "Jonny Paton" for my name

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.

2 participants