Skip to content

Fix #11301 debug: constStatementError not handled.#4463

Merged
orbitcowboy merged 2 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix11301
Sep 14, 2022
Merged

Fix #11301 debug: constStatementError not handled.#4463
orbitcowboy merged 2 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix11301

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread lib/checkother.cpp Outdated
if (tok->varId() != 0)
return true;
if (Token::Match(tok, "%bool%|%num%|%str%|%char%|nullptr|NULL"))
if (Token::Match(tok, constantMatchStr))
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.

Making it a variable prevents matchcompiling. Same below.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should we make it a #define instead?

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.

That's won't help either. The matchcompiler looks for inline strings and "compiles" them. No macro support.

It would help a non-matchcompiled build a bit though.

You could deduplicate the whole function call with a static one instead of just the string.

@orbitcowboy orbitcowboy merged commit d1386a8 into cppcheck-opensource:main Sep 14, 2022
@chrchr-github chrchr-github deleted the chr_Fix11301 branch October 22, 2022 09:45
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.

3 participants