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

`DCL60-CPP`: no alerts reported

Open mbaluda opened this issue 1 year ago • 2 comments

Affected rules

  • DCL60-CPP

Description

No alert is reported by this query. Even lines marked as COMPLIANT[FALSE_POSITIVE] in the test cases do not appear in the .expected file

mbaluda avatar May 22 '23 15:05 mbaluda

This rule only reports ODR violations where we are sure the two definitions coexist through static linking. Otherwise we could report false positive where multiple programs are represented in the same database that happen to have the same signature, but are never linked.

Unfortunately, there are limitations in our unit and compiler testing framework that made this rule difficult to test, because the test cases consist of separate translation units that are never linked together. ODR violations that don't span translation units are typically detected and rejected by the compiler, which makes it tricky to write a valid test case.

lcartey avatar May 26 '23 10:05 lcartey

Re-categorising as a test improvement.

lcartey avatar May 26 '23 10:05 lcartey