Skip to content

A7-1-2: Certain logging functions are reported because they are considered side-effect free #227

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
lcartey opened this issue Mar 3, 2023 · 2 comments
Assignees
Labels
awaiting-user-feedback false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Standard-AUTOSAR top-25-fps user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@lcartey
Copy link
Collaborator

lcartey commented Mar 3, 2023

Affected rules

  • A7-1-2

Description

A logging function cannot be marked as constexpr because it is intended to have a side-effect (writing a log entry). In certain cases we are marking logging functions under this rule, which likely means we are not identifying the side-effect. The query takes a conservative approach to identifying side effects i.e. it will err on the side of assuming side-effects unless it can prove otherwise, so we're possibly missing an edge case here.

Example

@lcartey lcartey added Impact-High user-report Issue reported by an end user of CodeQL Coding Standards false positive/false negative An issue related to observed false positives or false negatives. awaiting-user-feedback top-25-fps labels Mar 3, 2023
@lcartey
Copy link
Collaborator Author

lcartey commented Mar 17, 2023

We are awaiting more feedback, as we don't know what side-effect we might be missing for this case.

@lcartey
Copy link
Collaborator Author

lcartey commented Jan 20, 2025

I believe we shouldn't be reporting functions for this rule in any case, so closing this as a duplicate of #843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-user-feedback false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Standard-AUTOSAR top-25-fps user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Status: Closed (Duplicate)
Development

No branches or pull requests

2 participants