Skip to content

Commit 3213f1c

Browse files
authored
Merge branch 'main' into lcartey/m5-2-10-arith-only
2 parents 4ee1015 + 5e6a5b8 commit 3213f1c

File tree

97 files changed

+1109
-310
lines changed

Some content is hidden

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

97 files changed

+1109
-310
lines changed

.vscode/tasks.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,28 @@
140140
},
141141
"problemMatcher": []
142142
},
143+
{
144+
"label": "🧪 Standards Automation: Build Case Test DB from test file",
145+
"type": "shell",
146+
"windows": {
147+
"command": ".${pathSeparator}scripts${pathSeparator}.venv${pathSeparator}Scripts${pathSeparator}python.exe scripts${pathSeparator}build_test_database.py ${file}"
148+
},
149+
"linux": {
150+
"command": ".${pathSeparator}scripts${pathSeparator}.venv${pathSeparator}bin${pathSeparator}python3 scripts${pathSeparator}build_test_database.py ${file}"
151+
},
152+
"osx": {
153+
"command": ".${pathSeparator}scripts${pathSeparator}.venv${pathSeparator}bin${pathSeparator}python3 scripts${pathSeparator}build_test_database.py ${file}"
154+
},
155+
"presentation": {
156+
"reveal": "always",
157+
"panel": "new",
158+
"focus": true
159+
},
160+
"runOptions": {
161+
"reevaluateOnRerun": false
162+
},
163+
"problemMatcher": []
164+
},
143165
{
144166
"label": "📝 Standards Automation: Format CodeQL",
145167
"type": "shell",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Reuse the `IntegerLiteral` class
2+
import codingstandards.cpp.Cpp14Literal
3+
4+
class IntegerLiteral = Cpp14Literal::IntegerLiteral;

c/misra/src/rules/RULE-7-3/LowercaseCharacterLUsedInLiteralSuffix.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
import cpp
1616
import codingstandards.c.misra
17+
import codingstandards.c.Literals
1718

18-
from Literal l
19+
from IntegerLiteral l
1920
where
2021
not isExcluded(l, SyntaxPackage::lowercaseCharacterLUsedInLiteralSuffixQuery()) and
21-
not l instanceof StringLiteral and
2222
exists(l.getValueText().indexOf("l"))
2323
select l, "Lowercase 'l' used as a literal suffix."

c/misra/test/rules/RULE-7-3/cpp/LowercaseCharacterLUsedInLiteralSuffix.expected

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rules/RULE-7-3/LowercaseCharacterLUsedInLiteralSuffix.ql
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This test case was added to validate FP report [#319](https://github.com/github/codeql-coding-standards/issues/319) that occurs when this rule is run on a translation unit with language mode c++.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
semmle-extractor-options:--clang -std=c++14 --edg --diag_error=implicit_func_decl -nostdinc -I../../../../../cpp/common/test/includes/standard-library
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int x = false; // COMPLIANT - reported as FP in #319

c/misra/test/rules/RULE-7-3/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ long d9 = 001LU; // COMPLIANT
4141

4242
char *e1 = "";
4343
char *e2 = "ul";
44-
char *e3 = "UL";
44+
char *e3 = "UL";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* `A7-1-1` - no longer report parameters as contravening this rule. This is inline with the rule intent as described in the referenced C++ Core Guidelines rule [CON.1](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#con1-by-default-make-objects-immutable), which states "To avoid confusion and lots of false positives, don’t enforce this rule for function parameters."

0 commit comments

Comments
 (0)