File tree Expand file tree Collapse file tree 5 files changed +12
-19
lines changed
Expand file tree Collapse file tree 5 files changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,10 @@ where
2323 not isExcluded ( decl1 , Declarations4Package:: compatibleDeclarationObjectDefinedQuery ( ) ) and
2424 decl1 .isDefinition ( ) and
2525 decl1 .getDeclaration ( ) instanceof ExternalIdentifiers and
26- (
27- //no declaration matches exactly
28- not exists ( VariableDeclarationEntry decl2 |
29- not decl2 .isDefinition ( ) and decl2 .getDeclaration ( ) = decl1 .getDeclaration ( )
30- ) and
31- //and none is close enough
32- not exists ( VariableDeclarationEntry decl2 |
33- not decl2 .isDefinition ( ) and
34- decl1 .getVariable ( ) .getQualifiedName ( ) = decl2 .getVariable ( ) .getQualifiedName ( ) and
35- typesCompatible ( decl1 .getType ( ) , decl2 .getType ( ) )
36- )
26+ // no declaration matches
27+ not exists ( VariableDeclarationEntry decl2 |
28+ not decl2 .isDefinition ( ) and
29+ decl1 .getVariable ( ) .getQualifiedName ( ) = decl2 .getVariable ( ) .getQualifiedName ( ) and
30+ typesCompatible ( decl1 .getType ( ) , decl2 .getType ( ) )
3731 )
3832select decl1 , "No separate compatible declaration found for this definition."
Original file line number Diff line number Diff line change 1- | function2.c:5:6:5:7 | definition of f3 | No separate compatible declaration found for this definition. |
2- | function2.c:7:6:7:7 | definition of f4 | No separate compatible declaration found for this definition. |
1+ | object1.c:4:12:4:13 | definition of i1 | No separate compatible declaration found for this definition. |
2+ | object1.c:6:5:6:6 | definition of i2 | No separate compatible declaration found for this definition. |
3+ | object2.c:1:7:1:8 | definition of i3 | No separate compatible declaration found for this definition. |
Original file line number Diff line number Diff line change 11extern int i ;
2- i = 0 ; // COMPLIANT
2+ int i = 0 ; // COMPLIANT
33
44extern int i1 = 0 ; // NON_COMPLIANT
55
66int i2 = 0 ; // NON_COMPLIANT
77
8- // not detected as `short i3` exists
9- extern int i3 ; // NON_COMPLIANT[FALSE_NEGATIVE]
8+ extern int i3 ;
109
11- extern int i4 ; // COMPLIANT
10+ extern int i4 ;
Original file line number Diff line number Diff line change 1- // not detected as `extern int i3` exists
2- short i3 = 0 ; // NON_COMPLIANT[FALSE_NEGATIVE]
1+ short i3 = 0 ; // NON_COMPLIANT
32
43signed int i4 = 0 ; // COMPLIANT
You can’t perform that action at this time.
0 commit comments