Skip to content

Commit b42eeb2

Browse files
authored
Merge branch 'main' into Memory3
2 parents 163e23f + 6628857 commit b42eeb2

File tree

110 files changed

+7686
-753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+7686
-753
lines changed

.github/workflows/dispatch-matrix-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request_target:
55
types: [synchronize,opened]
66
branches:
7-
- "**"
7+
- "matrix/**"
88
workflow_dispatch:
99

1010
jobs:
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: 🤖 Run Matrix Check (On Comment)
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
dispatch-matrix-check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
12+
- name: Test Variables
13+
shell: pwsh
14+
run: |
15+
Write-Host "Running as: ${{github.actor}}"
16+
17+
$actor = "${{github.actor}}"
18+
19+
$acl = @("jsinglet","mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "kraiouchkine")
20+
21+
if(-not ($actor -in $acl)){
22+
throw "Refusing to run workflow for user not in acl."
23+
}
24+
25+
26+
- name: Dispatch Matrix Testing Job
27+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-matrix') }}
28+
uses: peter-evans/repository-dispatch@v2
29+
with:
30+
token: ${{ secrets.RELEASE_ENGINEERING_TOKEN }}
31+
repository: github/codeql-coding-standards-release-engineering
32+
event-type: matrix-test
33+
client-payload: '{"pr": "${{ github.event.number }}"}'
34+
35+
- uses: actions/github-script@v6
36+
with:
37+
script: |
38+
github.rest.issues.createComment({
39+
issue_number: context.issue.number,
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
body: '🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results. <br><br> :bulb: If you do not hear back from me please check my status! **I will report even if this PR does not contain files eligible for matrix testing.**'
43+
})

.vscode/tasks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@
253253
"Pointers1",
254254
"Pointers2",
255255
"Pointers3",
256+
"Representation",
256257
"Scope",
257258
"SideEffects1",
258259
"SideEffects2",
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# ARR36-C: Do not subtract two pointers that do not refer to the same array
2+
3+
This query implements the CERT-C rule ARR36-C:
4+
5+
> Do not subtract or compare two pointers that do not refer to the same array
6+
7+
8+
## Description
9+
10+
When two pointers are subtracted, both must point to elements of the same array object or just one past the last element of the array object (C Standard, 6.5.6 \[[ISO/IEC 9899:2011](https://wiki.sei.cmu.edu/confluence/display/c/AA.+Bibliography#AA.Bibliography-ISO-IEC9899-2011)\]); the result is the difference of the subscripts of the two array elements. Otherwise, the operation is [undefined behavior](https://wiki.sei.cmu.edu/confluence/display/c/BB.+Definitions#BB.Definitions-undefinedbehavior). (See [undefined behavior 48](https://wiki.sei.cmu.edu/confluence/display/c/CC.+Undefined+Behavior#CC.UndefinedBehavior-ub_48).)
11+
12+
Similarly, comparing pointers using the relational operators `<`, `<=`, `>=`, and `>` gives the positions of the pointers relative to each other. Subtracting or comparing pointers that do not refer to the same array is undefined behavior. (See [undefined behavior 48](https://wiki.sei.cmu.edu/confluence/display/c/CC.+Undefined+Behavior#CC.UndefinedBehavior-ub_48) and [undefined behavior 53](https://wiki.sei.cmu.edu/confluence/display/c/CC.+Undefined+Behavior#CC.UndefinedBehavior-ub_53).)
13+
14+
Comparing pointers using the equality operators `==` and `!=` has well-defined semantics regardless of whether or not either of the pointers is null, points into the same object, or points one past the last element of an array object or function.
15+
16+
## Noncompliant Code Example
17+
18+
In this noncompliant code example, pointer subtraction is used to determine how many free elements are left in the `nums` array:
19+
20+
```cpp
21+
#include <stddef.h>
22+
23+
enum { SIZE = 32 };
24+
25+
void func(void) {
26+
int nums[SIZE];
27+
int end;
28+
int *next_num_ptr = nums;
29+
size_t free_elements;
30+
31+
/* Increment next_num_ptr as array fills */
32+
33+
free_elements = &end - next_num_ptr;
34+
}
35+
```
36+
This program incorrectly assumes that the `nums` array is adjacent to the `end` variable in memory. A compiler is permitted to insert padding bits between these two variables or even reorder them in memory.
37+
38+
## Compliant Solution
39+
40+
In this compliant solution, the number of free elements is computed by subtracting `next_num_ptr` from the address of the pointer past the `nums` array. While this pointer may not be dereferenced, it may be used in pointer arithmetic.
41+
42+
```cpp
43+
#include <stddef.h>
44+
enum { SIZE = 32 };
45+
46+
void func(void) {
47+
int nums[SIZE];
48+
int *next_num_ptr = nums;
49+
size_t free_elements;
50+
51+
/* Increment next_num_ptr as array fills */
52+
53+
free_elements = &(nums[SIZE]) - next_num_ptr;
54+
}
55+
```
56+
57+
## Exceptions
58+
59+
**ARR36-C-EX1:**Comparing two pointers to distinct members of the same `struct` object is allowed. Pointers to structure members declared later in the structure compare greater-than pointers to members declared earlier in the structure.
60+
61+
## Risk Assessment
62+
63+
<table> <tbody> <tr> <th> Rule </th> <th> Severity </th> <th> Likelihood </th> <th> Remediation Cost </th> <th> Priority </th> <th> Level </th> </tr> <tr> <td> ARR36-C </td> <td> Medium </td> <td> Probable </td> <td> Medium </td> <td> <strong>P8</strong> </td> <td> <strong>L2</strong> </td> </tr> </tbody> </table>
64+
65+
66+
## Automated Detection
67+
68+
<table> <tbody> <tr> <th> Tool </th> <th> Version </th> <th> Checker </th> <th> Description </th> </tr> <tr> <td> <a> Astrée </a> </td> <td> 22.04 </td> <td> <strong>pointer-subtraction</strong> </td> <td> Partially checked </td> </tr> <tr> <td> <a> Axivion Bauhaus Suite </a> </td> <td> 7.2.0 </td> <td> <strong>CertC-ARR36</strong> </td> <td> Can detect operations on pointers that are unrelated </td> </tr> <tr> <td> <a> CodeSonar </a> </td> <td> 7.2p0 </td> <td> <strong>LANG.STRUCT.CUP</strong> <strong>LANG.STRUCT.SUP</strong> </td> <td> Comparison of Unrelated Pointers Subtraction of Unrelated Pointers </td> </tr> <tr> <td> <a> Coverity </a> </td> <td> 2017.07 </td> <td> <strong>MISRA C 2004 17.2</strong> <strong>MISRA C 2004 17.3</strong> <strong>MISRA C 2012 18.2</strong> <strong>MISRA C 2012 18.3</strong> </td> <td> Implemented </td> </tr> <tr> <td> <a> Helix QAC </a> </td> <td> 2022.4 </td> <td> <strong>C0487, C0513</strong> <strong>DF2668, DF2669, DF2761, DF2762, DF2763, DF2766, DF2767, DF2768, DF2771, DF2772, DF2773</strong> </td> <td> </td> </tr> <tr> <td> <a> Klocwork </a> </td> <td> 2022.4 </td> <td> <strong>MISRA.PTR.ARITH</strong> </td> <td> </td> </tr> <tr> <td> <a> LDRA tool suite </a> </td> <td> 9.7.1 </td> <td> <strong>437 S, 438 S</strong> </td> <td> Fully implemented </td> </tr> <tr> <td> <a> Parasoft C/C++test </a> </td> <td> 2022.2 </td> <td> <strong>CERT_C-ARR36-aCERT_C-ARR36-b</strong> </td> <td> Do not subtract two pointers that do not address elements of the same array Do not compare two unrelated pointers </td> </tr> <tr> <td> <a> Polyspace Bug Finder </a> </td> <td> R2023a </td> <td> <a> CERT C: Rule ARR36-C </a> </td> <td> Checks for subtraction or comparison between pointers to different arrays (rule partially covered) </td> </tr> <tr> <td> <a> PRQA QA-C </a> </td> <td> 9.7 </td> <td> <strong>0487, 0513, 2668, 2669, 2761,</strong> <strong> 2762, 2763, 2766, 2767, 2768, </strong> <strong>2771, 2772, 2773</strong> </td> <td> Fully implemented </td> </tr> <tr> <td> <a> PVS-Studio </a> </td> <td> 7.23 </td> <td> <strong>V736<a></a></strong> , <strong><a>V782</a></strong> </td> <td> </td> </tr> <tr> <td> <a> RuleChecker </a> </td> <td> 22.04 </td> <td> <strong>pointer-subtraction</strong> </td> <td> Partially checked </td> </tr> <tr> <td> <a> TrustInSoft Analyzer </a> </td> <td> 1.38 </td> <td> <strong>differing_blocks</strong> </td> <td> Exhaustively verified (see <a> the compliant and the non-compliant example </a> ). </td> </tr> </tbody> </table>
69+
70+
71+
## Related Vulnerabilities
72+
73+
Search for [vulnerabilities](https://wiki.sei.cmu.edu/confluence/display/c/BB.+Definitions#BB.Definitions-vulnerability) resulting from the violation of this rule on the [CERT website](https://www.kb.cert.org/vulnotes/bymetric?searchview&query=FIELD+KEYWORDS+contains+ARR36-C).
74+
75+
## Related Guidelines
76+
77+
[Key here](https://wiki.sei.cmu.edu/confluence/display/c/How+this+Coding+Standard+is+Organized#HowthisCodingStandardisOrganized-RelatedGuidelines) (explains table format and definitions)
78+
79+
<table> <tbody> <tr> <th> Taxonomy </th> <th> Taxonomy item </th> <th> Relationship </th> </tr> <tr> <td> <a> CERT C </a> </td> <td> <a> CTR54-CPP. Do not subtract iterators that do not refer to the same container </a> </td> <td> Prior to 2018-01-12: CERT: Unspecified Relationship </td> </tr> <tr> <td> <a> ISO/IEC TS 17961 </a> </td> <td> Subtracting or comparing two pointers that do not refer to the same array \[ptrobj\] </td> <td> Prior to 2018-01-12: CERT: Unspecified Relationship </td> </tr> <tr> <td> <a> CWE 2.11 </a> </td> <td> <a> CWE-469 </a> , Use of Pointer Subtraction to Determine Size </td> <td> 2017-07-10: CERT: Exact </td> </tr> <tr> <td> <a> CWE 3.11 </a> </td> <td> <a> CWE-469 </a> , Use of Pointer Subtraction to Determine Size </td> <td> 2018-10-18:CERT: CWE subset of rule </td> </tr> </tbody> </table>
80+
81+
82+
## CERT-CWE Mapping Notes
83+
84+
[Key here](https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152408#HowthisCodingStandardisOrganized-CERT-CWEMappingNotes) for mapping notes
85+
86+
**CWE-469 and ARR36-C**
87+
88+
CWE-469 = Subset(ARR36-C)
89+
90+
ARR36-C = Union(CWE-469, list) where list =
91+
92+
* Pointer comparisons using the relational operators `<`, `<=`, `>=`, and `>`, where the pointers do not refer to the same array
93+
94+
## Bibliography
95+
96+
<table> <tbody> <tr> <td> \[ <a> Banahan 2003 </a> \] </td> <td> <a> Section 5.3, "Pointers" </a> <a> Section 5.7, "Expressions Involving Pointers" </a> </td> </tr> <tr> <td> \[ <a> ISO/IEC 9899:2011 </a> \] </td> <td> 6.5.6, "Additive Operators" </td> </tr> </tbody> </table>
97+
98+
99+
## Implementation notes
100+
101+
None
102+
103+
## References
104+
105+
* CERT-C: [ARR36-C: Do not subtract or compare two pointers that do not refer to the same array](https://wiki.sei.cmu.edu/confluence/display/c)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @id c/cert/do-not-relate-pointers-that-do-not-refer-to-the-same-array
3+
* @name ARR36-C: Do not subtract two pointers that do not refer to the same array
4+
* @description Comparison using the >, >=, <, and <= operators between pointers referring to
5+
* differing arrays results in undefined behavior.
6+
* @kind path-problem
7+
* @precision high
8+
* @problem.severity warning
9+
* @tags external/cert/id/arr36-c
10+
* correctness
11+
* external/cert/obligation/rule
12+
*/
13+
14+
import cpp
15+
import codingstandards.c.cert
16+
import codingstandards.cpp.rules.donotuserelationaloperatorswithdifferingarrays.DoNotUseRelationalOperatorsWithDifferingArrays
17+
18+
class DoNotRelatePointersThatDoNotReferToTheSameArrayQuery extends DoNotUseRelationalOperatorsWithDifferingArraysSharedQuery {
19+
DoNotRelatePointersThatDoNotReferToTheSameArrayQuery() {
20+
this = Memory2Package::doNotRelatePointersThatDoNotReferToTheSameArrayQuery()
21+
}
22+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# ARR36-C: Do not subtract two pointers that do not refer to the same array
2+
3+
This query implements the CERT-C rule ARR36-C:
4+
5+
> Do not subtract or compare two pointers that do not refer to the same array
6+
7+
8+
## Description
9+
10+
When two pointers are subtracted, both must point to elements of the same array object or just one past the last element of the array object (C Standard, 6.5.6 \[[ISO/IEC 9899:2011](https://wiki.sei.cmu.edu/confluence/display/c/AA.+Bibliography#AA.Bibliography-ISO-IEC9899-2011)\]); the result is the difference of the subscripts of the two array elements. Otherwise, the operation is [undefined behavior](https://wiki.sei.cmu.edu/confluence/display/c/BB.+Definitions#BB.Definitions-undefinedbehavior). (See [undefined behavior 48](https://wiki.sei.cmu.edu/confluence/display/c/CC.+Undefined+Behavior#CC.UndefinedBehavior-ub_48).)
11+
12+
Similarly, comparing pointers using the relational operators `<`, `<=`, `>=`, and `>` gives the positions of the pointers relative to each other. Subtracting or comparing pointers that do not refer to the same array is undefined behavior. (See [undefined behavior 48](https://wiki.sei.cmu.edu/confluence/display/c/CC.+Undefined+Behavior#CC.UndefinedBehavior-ub_48) and [undefined behavior 53](https://wiki.sei.cmu.edu/confluence/display/c/CC.+Undefined+Behavior#CC.UndefinedBehavior-ub_53).)
13+
14+
Comparing pointers using the equality operators `==` and `!=` has well-defined semantics regardless of whether or not either of the pointers is null, points into the same object, or points one past the last element of an array object or function.
15+
16+
## Noncompliant Code Example
17+
18+
In this noncompliant code example, pointer subtraction is used to determine how many free elements are left in the `nums` array:
19+
20+
```cpp
21+
#include <stddef.h>
22+
23+
enum { SIZE = 32 };
24+
25+
void func(void) {
26+
int nums[SIZE];
27+
int end;
28+
int *next_num_ptr = nums;
29+
size_t free_elements;
30+
31+
/* Increment next_num_ptr as array fills */
32+
33+
free_elements = &end - next_num_ptr;
34+
}
35+
```
36+
This program incorrectly assumes that the `nums` array is adjacent to the `end` variable in memory. A compiler is permitted to insert padding bits between these two variables or even reorder them in memory.
37+
38+
## Compliant Solution
39+
40+
In this compliant solution, the number of free elements is computed by subtracting `next_num_ptr` from the address of the pointer past the `nums` array. While this pointer may not be dereferenced, it may be used in pointer arithmetic.
41+
42+
```cpp
43+
#include <stddef.h>
44+
enum { SIZE = 32 };
45+
46+
void func(void) {
47+
int nums[SIZE];
48+
int *next_num_ptr = nums;
49+
size_t free_elements;
50+
51+
/* Increment next_num_ptr as array fills */
52+
53+
free_elements = &(nums[SIZE]) - next_num_ptr;
54+
}
55+
```
56+
57+
## Exceptions
58+
59+
**ARR36-C-EX1:**Comparing two pointers to distinct members of the same `struct` object is allowed. Pointers to structure members declared later in the structure compare greater-than pointers to members declared earlier in the structure.
60+
61+
## Risk Assessment
62+
63+
<table> <tbody> <tr> <th> Rule </th> <th> Severity </th> <th> Likelihood </th> <th> Remediation Cost </th> <th> Priority </th> <th> Level </th> </tr> <tr> <td> ARR36-C </td> <td> Medium </td> <td> Probable </td> <td> Medium </td> <td> <strong>P8</strong> </td> <td> <strong>L2</strong> </td> </tr> </tbody> </table>
64+
65+
66+
## Automated Detection
67+
68+
<table> <tbody> <tr> <th> Tool </th> <th> Version </th> <th> Checker </th> <th> Description </th> </tr> <tr> <td> <a> Astrée </a> </td> <td> 22.04 </td> <td> <strong>pointer-subtraction</strong> </td> <td> Partially checked </td> </tr> <tr> <td> <a> Axivion Bauhaus Suite </a> </td> <td> 7.2.0 </td> <td> <strong>CertC-ARR36</strong> </td> <td> Can detect operations on pointers that are unrelated </td> </tr> <tr> <td> <a> CodeSonar </a> </td> <td> 7.2p0 </td> <td> <strong>LANG.STRUCT.CUP</strong> <strong>LANG.STRUCT.SUP</strong> </td> <td> Comparison of Unrelated Pointers Subtraction of Unrelated Pointers </td> </tr> <tr> <td> <a> Coverity </a> </td> <td> 2017.07 </td> <td> <strong>MISRA C 2004 17.2</strong> <strong>MISRA C 2004 17.3</strong> <strong>MISRA C 2012 18.2</strong> <strong>MISRA C 2012 18.3</strong> </td> <td> Implemented </td> </tr> <tr> <td> <a> Helix QAC </a> </td> <td> 2022.4 </td> <td> <strong>C0487, C0513</strong> <strong>DF2668, DF2669, DF2761, DF2762, DF2763, DF2766, DF2767, DF2768, DF2771, DF2772, DF2773</strong> </td> <td> </td> </tr> <tr> <td> <a> Klocwork </a> </td> <td> 2022.4 </td> <td> <strong>MISRA.PTR.ARITH</strong> </td> <td> </td> </tr> <tr> <td> <a> LDRA tool suite </a> </td> <td> 9.7.1 </td> <td> <strong>437 S, 438 S</strong> </td> <td> Fully implemented </td> </tr> <tr> <td> <a> Parasoft C/C++test </a> </td> <td> 2022.2 </td> <td> <strong>CERT_C-ARR36-aCERT_C-ARR36-b</strong> </td> <td> Do not subtract two pointers that do not address elements of the same array Do not compare two unrelated pointers </td> </tr> <tr> <td> <a> Polyspace Bug Finder </a> </td> <td> R2023a </td> <td> <a> CERT C: Rule ARR36-C </a> </td> <td> Checks for subtraction or comparison between pointers to different arrays (rule partially covered) </td> </tr> <tr> <td> <a> PRQA QA-C </a> </td> <td> 9.7 </td> <td> <strong>0487, 0513, 2668, 2669, 2761,</strong> <strong> 2762, 2763, 2766, 2767, 2768, </strong> <strong>2771, 2772, 2773</strong> </td> <td> Fully implemented </td> </tr> <tr> <td> <a> PVS-Studio </a> </td> <td> 7.23 </td> <td> <strong>V736<a></a></strong> , <strong><a>V782</a></strong> </td> <td> </td> </tr> <tr> <td> <a> RuleChecker </a> </td> <td> 22.04 </td> <td> <strong>pointer-subtraction</strong> </td> <td> Partially checked </td> </tr> <tr> <td> <a> TrustInSoft Analyzer </a> </td> <td> 1.38 </td> <td> <strong>differing_blocks</strong> </td> <td> Exhaustively verified (see <a> the compliant and the non-compliant example </a> ). </td> </tr> </tbody> </table>
69+
70+
71+
## Related Vulnerabilities
72+
73+
Search for [vulnerabilities](https://wiki.sei.cmu.edu/confluence/display/c/BB.+Definitions#BB.Definitions-vulnerability) resulting from the violation of this rule on the [CERT website](https://www.kb.cert.org/vulnotes/bymetric?searchview&query=FIELD+KEYWORDS+contains+ARR36-C).
74+
75+
## Related Guidelines
76+
77+
[Key here](https://wiki.sei.cmu.edu/confluence/display/c/How+this+Coding+Standard+is+Organized#HowthisCodingStandardisOrganized-RelatedGuidelines) (explains table format and definitions)
78+
79+
<table> <tbody> <tr> <th> Taxonomy </th> <th> Taxonomy item </th> <th> Relationship </th> </tr> <tr> <td> <a> CERT C </a> </td> <td> <a> CTR54-CPP. Do not subtract iterators that do not refer to the same container </a> </td> <td> Prior to 2018-01-12: CERT: Unspecified Relationship </td> </tr> <tr> <td> <a> ISO/IEC TS 17961 </a> </td> <td> Subtracting or comparing two pointers that do not refer to the same array \[ptrobj\] </td> <td> Prior to 2018-01-12: CERT: Unspecified Relationship </td> </tr> <tr> <td> <a> CWE 2.11 </a> </td> <td> <a> CWE-469 </a> , Use of Pointer Subtraction to Determine Size </td> <td> 2017-07-10: CERT: Exact </td> </tr> <tr> <td> <a> CWE 3.11 </a> </td> <td> <a> CWE-469 </a> , Use of Pointer Subtraction to Determine Size </td> <td> 2018-10-18:CERT: CWE subset of rule </td> </tr> </tbody> </table>
80+
81+
82+
## CERT-CWE Mapping Notes
83+
84+
[Key here](https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152408#HowthisCodingStandardisOrganized-CERT-CWEMappingNotes) for mapping notes
85+
86+
**CWE-469 and ARR36-C**
87+
88+
CWE-469 = Subset(ARR36-C)
89+
90+
ARR36-C = Union(CWE-469, list) where list =
91+
92+
* Pointer comparisons using the relational operators `<`, `<=`, `>=`, and `>`, where the pointers do not refer to the same array
93+
94+
## Bibliography
95+
96+
<table> <tbody> <tr> <td> \[ <a> Banahan 2003 </a> \] </td> <td> <a> Section 5.3, "Pointers" </a> <a> Section 5.7, "Expressions Involving Pointers" </a> </td> </tr> <tr> <td> \[ <a> ISO/IEC 9899:2011 </a> \] </td> <td> 6.5.6, "Additive Operators" </td> </tr> </tbody> </table>
97+
98+
99+
## Implementation notes
100+
101+
None
102+
103+
## References
104+
105+
* CERT-C: [ARR36-C: Do not subtract or compare two pointers that do not refer to the same array](https://wiki.sei.cmu.edu/confluence/display/c)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @id c/cert/do-not-subtract-pointers-that-do-not-refer-to-the-same-array
3+
* @name ARR36-C: Do not subtract two pointers that do not refer to the same array
4+
* @description Subtraction between pointers referring to differing arrays results in undefined
5+
* behavior.
6+
* @kind path-problem
7+
* @precision high
8+
* @problem.severity warning
9+
* @tags external/cert/id/arr36-c
10+
* correctness
11+
* external/cert/obligation/rule
12+
*/
13+
14+
import cpp
15+
import codingstandards.c.cert
16+
import codingstandards.cpp.rules.donotsubtractpointersaddressingdifferentarrays.DoNotSubtractPointersAddressingDifferentArrays
17+
18+
class DoNotSubtractPointersThatDoNotReferToTheSameArrayQuery extends DoNotSubtractPointersAddressingDifferentArraysSharedQuery {
19+
DoNotSubtractPointersThatDoNotReferToTheSameArrayQuery() {
20+
this = Memory2Package::doNotSubtractPointersThatDoNotReferToTheSameArrayQuery()
21+
}
22+
}

0 commit comments

Comments
 (0)