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

lib: os: cbprintf: Suppress coverity false positive #34063

Merged

Conversation

nordic-krch
Copy link
Contributor

Coverity is complaining about sizeof(v + 0) and it is used
here intentionally to promote variable. Added comment that should
suppress this error in the future.

Note that this macro will be used in all log messages so without
solving it before logging v2 is merged there will be a flood of
errors.

Fixes #33840.
Fixes #33815.

Signed-off-by: Krzysztof Chruscinski [email protected]

Coverity is complaining about sizeof(v + 0) and it is used
here intentionally to promote variable. Added comment that should
suppress this error in the future.

Note that this macro will be used in all log messages so without
solving it before logging v2 is merged there will be a flood of
errors.

Signed-off-by: Krzysztof Chruscinski <[email protected]>
@nordic-krch nordic-krch added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix labels Apr 7, 2021
@github-actions github-actions bot added the area: API Changes to public APIs label Apr 7, 2021
@zephyrbot zephyrbot added the area: Base OS Base OS Library (lib/os) label Apr 7, 2021
Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

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

We don't usually specify this in the code, instead marking the corresponding coverity issue as false positive. @nashif and @galak thoughts?

@nordic-krch
Copy link
Contributor Author

@carlescufi the problem is that it is used in a macro which will be used by the logging so there will be hundreds of false positive issues.

@galak
Copy link
Collaborator

galak commented Apr 9, 2021

@carlescufi the problem is that it is used in a macro which will be used by the logging so there will be hundreds of false positive issues.

For such cases, I don't have any issues with do this.

@nordic-krch
Copy link
Contributor Author

@carlescufi so are you ok with leaving it as is?

@nordic-krch
Copy link
Contributor Author

@carlescufi what do we do about it. As logging overhaul got merged we will be spammed with same coverity issue for each log macro usage.

@carlescufi
Copy link
Member

@carlescufi what do we do about it. As logging overhaul got merged we will be spammed with same coverity issue for each log macro usage.

Let's get it in, I don't have a better idea.

@carlescufi carlescufi merged commit e5eb1b1 into zephyrproject-rtos:master Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Base OS Base OS Library (lib/os) bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix
Projects
None yet
6 participants