Skip to content

Commit 90c7555

Browse files
committed
Merge branch 'knewbury01/Declarations6' of https://github.com/knewbury01/codeql-coding-standards into knewbury01/Declarations6
2 parents 874a518 + 350b2a0 commit 90c7555

File tree

54 files changed

+741
-73
lines changed

Some content is hidden

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

54 files changed

+741
-73
lines changed

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ _**Author:**_ Is a change note required?
3232
- [ ] Yes
3333
- [ ] No
3434

35+
🚨🚨🚨
36+
_**Reviewer:**_ Confirm that format of *shared* queries (not the .qll file, the
37+
.ql file that imports it) is valid by running them within VS Code.
38+
- [ ] Confirmed
39+
40+
3541
_**Reviewer:**_ Confirm that either a change note is not required or the change note is required and has been added.
3642
- [ ] Confirmed
3743

.vscode/tasks.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@
206206
"Declarations",
207207
"Declarations1",
208208
"Declarations2",
209+
"Declarations3",
210+
"Declarations4",
209211
"Declarations6",
210212
"Exceptions1",
211213
"Exceptions2",

c/common/src/codingstandards/c/Identifiers.qll

Lines changed: 0 additions & 19 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| test.c:1:5:1:6 | definition of g1 | The identifier g1 has external linkage and is redefined $@. | test1.c:1:5:1:6 | definition of g1 | here |
2+
| test.c:6:6:6:7 | definition of f2 | The identifier f2 has external linkage and is redefined $@. | test1.c:6:6:6:7 | definition of f2 | here |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// GENERATED FILE - DO NOT MODIFY
2+
import codingstandards.cpp.rules.identifierwithexternallinkageonedefinitionshared.IdentifierWithExternalLinkageOneDefinitionShared
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int g1 = 1; // NON_COMPLIANT
2+
static int g2 = 1; // COMPLIANT; internal linkage
3+
4+
inline void f1() {} // COMPLIANT; inline functions are an exception
5+
6+
void f2() {} // NON_COMPLIANT
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int g1 = 0; // NON_COMPLIANT
2+
static int g2 = 1; // COMPLIANT; internal linkage
3+
4+
inline void f1() {} // COMPLIANT; inline functions are an exception
5+
6+
void f2() {} // NON_COMPLIANT

c/misra/src/rules/RULE-5-5/IdentifiersNotDistinctFromMacroNames.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import cpp
1616
import codingstandards.c.misra
17-
import codingstandards.c.Identifiers
17+
import codingstandards.cpp.Identifiers
1818

1919
from Macro m, InterestingIdentifiers i, string mName, string iName
2020
where

c/misra/src/rules/RULE-5-6/TypedefNameNotUnique.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import cpp
1616
import codingstandards.c.misra
17-
import codingstandards.c.Identifiers
17+
import codingstandards.cpp.Identifiers
1818

1919
from TypedefType t, InterestingIdentifiers d
2020
where

c/misra/src/rules/RULE-5-7/TagNameNotUnique.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import cpp
1616
import codingstandards.c.misra
17-
import codingstandards.c.Identifiers
17+
import codingstandards.cpp.Identifiers
1818

1919
from Struct s, InterestingIdentifiers s2
2020
where

0 commit comments

Comments
 (0)