We noticed false positives when testing SAL annotations.
These three should demonstrate the issue:
sal.h:
test.cpp:
#include "sal.h"
int method1() {
return _SAL_VERSION;
}
void method2();
test.ql:
import Microsoft.SAL
from SALAnnotation a
select a, a.getDeclaration()
Output from the query:
| test.cpp:3:12:3:23 | _SAL_VERSION | test.cpp:5:6:5:12 | method2 |
It seems the detection is based on "rank" and the fact that MacroInvocation _SAL_VERSION is before DeclarationEntry method2.
Not sure what is the best fix, can you please advise? Thank you.
We noticed false positives when testing SAL annotations.
These three should demonstrate the issue:
sal.h:test.cpp:test.ql:import Microsoft.SAL from SALAnnotation a select a, a.getDeclaration()Output from the query:
It seems the detection is based on "rank" and the fact that
MacroInvocation _SAL_VERSIONis beforeDeclarationEntry method2.Not sure what is the best fix, can you please advise? Thank you.