codeql-coding-standards icon indicating copy to clipboard operation
codeql-coding-standards copied to clipboard

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

Open lcartey opened this issue 1 year ago • 1 comments

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 avatar Mar 03 '23 11:03 lcartey

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

lcartey avatar Mar 17 '23 14:03 lcartey