-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rp/pre32-c-650
- Loading branch information
Showing
797 changed files
with
10,189 additions
and
1,566 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
c/cert/test/rules/INT30-C/UnsignedIntegerOperationsWrapAround.expected
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
c/cert/test/rules/INT30-C/UnsignedIntegerOperationsWrapAround.qlref
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
c/cert/test/rules/INT30-C/UnsignedIntegerOperationsWrapAround.testref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
c/common/test/rules/unsignedoperationwithconstantoperandswraps/UnsignedOperationWithConstantOperandsWraps.ql |
2 changes: 1 addition & 1 deletion
2
c/cert/test/rules/MSC30-C/RandUsedForGeneratingPseudorandomNumbers.testref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
cpp/common/test/rules/donotuserandforgeneratingpseudorandomnumbers/DoNotUseRandForGeneratingPseudorandomNumbers.ql | ||
c/common/test/rules/donotuserandforgeneratingpseudorandomnumbers/DoNotUseRandForGeneratingPseudorandomNumbers.ql |
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.../MacroParameterUsedAsHashOperand.expected → ...eMacroArgumentSubjectToExpansion.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
| test.c:4:1:4:41 | #define BAD_MACRO_WITH_ARG(x) (x) + wow ## x | Macro BAD_MACRO_WITH_ARG contains use of parameter x used in multiple contexts. | | ||
| test.c:5:1:5:48 | #define BAD_MACRO_WITH_ARG_TWO(x,y) (x) + wow ## x | Macro BAD_MACRO_WITH_ARG_TWO contains use of parameter x used in multiple contexts. | | ||
| test.c:5:1:5:41 | #define BAD_MACRO_WITH_ARG(x) (x) + wow ## x | Macro BAD_MACRO_WITH_ARG contains use of parameter x used in multiple contexts. | | ||
| test.c:6:1:6:48 | #define BAD_MACRO_WITH_ARG_TWO(x,y) (x) + wow ## x | Macro BAD_MACRO_WITH_ARG_TWO contains use of parameter x used in multiple contexts. | |
4 changes: 4 additions & 0 deletions
4
...ules/amixedusemacroargumentsubjecttoexpansion/AMixedUseMacroArgumentSubjectToExpansion.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// GENERATED FILE - DO NOT MODIFY | ||
import codingstandards.cpp.rules.amixedusemacroargumentsubjecttoexpansion.AMixedUseMacroArgumentSubjectToExpansion | ||
|
||
class TestFileQuery extends AMixedUseMacroArgumentSubjectToExpansionSharedQuery, TestQuery { } |
26 changes: 26 additions & 0 deletions
26
c/common/test/rules/amixedusemacroargumentsubjecttoexpansion/test.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND | ||
// CHANGES SHOULD BE REFLECTED THERE AS WELL. | ||
#define GOOD_MACRO_WITH_ARG(X) ((X)*X##_scale) // COMPLIANT | ||
#define MACRO 1 | ||
#define BAD_MACRO_WITH_ARG(x) (x) + wow##x // NON_COMPLIANT | ||
#define BAD_MACRO_WITH_ARG_TWO(x, y) (x) + wow##x // NON_COMPLIANT | ||
#define MACROONE(x) #x // COMPLIANT | ||
#define MACROTWO(x) x *x // COMPLIANT | ||
#define MACROTHREE(x) "##\"\"'" + (x) // COMPLIANT | ||
#define FOO(x) #x MACROONE(x) // COMPLIANT - no further arg expansion | ||
|
||
void f() { | ||
|
||
int x; | ||
int x_scale; | ||
int y; | ||
int wowMACRO = 0; | ||
|
||
y = GOOD_MACRO_WITH_ARG(x); | ||
wowMACRO = BAD_MACRO_WITH_ARG(MACRO); | ||
wowMACRO = BAD_MACRO_WITH_ARG_TWO(MACRO, 1); | ||
char s[] = MACROONE(MACRO); | ||
y = MACROTWO(MACRO); | ||
MACROTHREE(MACRO); | ||
FOO(x); | ||
} |
4 changes: 4 additions & 0 deletions
4
c/common/test/rules/atofatoiatolandatollused/AtofAtoiAtolAndAtollUsed.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
| test.c:8:14:8:17 | call to atof | Call to banned function atof. | | ||
| test.c:9:12:9:15 | call to atoi | Call to banned function atoi. | | ||
| test.c:10:13:10:16 | call to atol | Call to banned function atol. | | ||
| test.c:11:18:11:22 | call to atoll | Call to banned function atoll. | |
4 changes: 4 additions & 0 deletions
4
c/common/test/rules/atofatoiatolandatollused/AtofAtoiAtolAndAtollUsed.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// GENERATED FILE - DO NOT MODIFY | ||
import codingstandards.cpp.rules.atofatoiatolandatollused.AtofAtoiAtolAndAtollUsed | ||
|
||
class TestFileQuery extends AtofAtoiAtolAndAtollUsedSharedQuery, TestQuery { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND | ||
// CHANGES SHOULD BE REFLECTED THERE AS WELL. | ||
#include <float.h> | ||
#include <stdlib.h> | ||
void f2(); | ||
void f1() { | ||
char l1[5] = "abcd"; | ||
float l2 = atof(l1); // NON_COMLIANT | ||
int l3 = atoi(l1); // NON_COMPLIANT | ||
long l4 = atol(l1); // NON_COMPLIANT | ||
long long l5 = atoll(l1); // NON_COMPLIANT | ||
f2(); // COMPLIANT | ||
} |
4 changes: 4 additions & 0 deletions
4
...test/rules/bitfieldshallhaveanappropriatetype/BitFieldShallHaveAnAppropriateType.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
| test.c:8:7:8:8 | x1 | Bit-field 'x1' is declared on type 'int'. | | ||
| test.c:12:15:12:16 | x5 | Bit-field 'x5' is declared on type 'signed long'. | | ||
| test.c:14:15:14:16 | x6 | Bit-field 'x6' is declared on type 'signed char'. | | ||
| test.c:16:14:16:15 | x7 | Bit-field 'x7' is declared on type 'Color'. | |
4 changes: 4 additions & 0 deletions
4
c/common/test/rules/bitfieldshallhaveanappropriatetype/BitFieldShallHaveAnAppropriateType.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// GENERATED FILE - DO NOT MODIFY | ||
import codingstandards.cpp.rules.bitfieldshallhaveanappropriatetype.BitFieldShallHaveAnAppropriateType | ||
|
||
class TestFileQuery extends BitFieldShallHaveAnAppropriateTypeSharedQuery, TestQuery { } |
17 changes: 17 additions & 0 deletions
17
c/common/test/rules/bitfieldshallhaveanappropriatetype/test.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND | ||
// CHANGES SHOULD BE REFLECTED THERE AS WELL. | ||
typedef unsigned int UINT16; | ||
|
||
enum Color { R, G, B }; | ||
|
||
struct SampleStruct { | ||
int x1 : 2; // NON_COMPLIANT - not explicitly signed or unsigned | ||
unsigned int x2 : 2; // COMPLIANT - explicitly unsigned | ||
signed int x3 : 2; // COMPLIANT - explicitly signed | ||
UINT16 x4 : 2; // COMPLIANT - type alias resolves to a compliant type | ||
signed long x5 : 2; // NON_COMPLIANT - cannot declare bit field for long, even | ||
// if it's signed | ||
signed char x6 : 2; // NON_COMPLIANT - cannot declare bit field for char, even | ||
// if it's signed | ||
enum Color x7 : 3; // NON_COMPLIANT - cannot declare bit field for enum | ||
} sample_struct; |
32 changes: 16 additions & 16 deletions
32
c/common/test/rules/constlikereturnvalue/ConstLikeReturnValue.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
problems | ||
| test.c:8:8:8:12 | c_str | test.c:15:16:15:21 | call to getenv | test.c:8:8:8:12 | c_str | The object returned by the function getenv should not be modified. | | ||
| test.c:64:5:64:9 | conv4 | test.c:61:11:61:20 | call to localeconv | test.c:64:5:64:9 | conv4 | The object returned by the function localeconv should not be modified. | | ||
| test.c:73:5:73:8 | conv | test.c:69:25:69:34 | call to localeconv | test.c:73:5:73:8 | conv | The object returned by the function localeconv should not be modified. | | ||
| test.c:11:8:11:12 | c_str | test.c:18:16:18:21 | call to getenv | test.c:11:8:11:12 | c_str | The object returned by the function getenv should not be modified. | | ||
| test.c:67:5:67:9 | conv4 | test.c:64:11:64:20 | call to localeconv | test.c:67:5:67:9 | conv4 | The object returned by the function localeconv should not be modified. | | ||
| test.c:76:5:76:8 | conv | test.c:72:25:72:34 | call to localeconv | test.c:76:5:76:8 | conv | The object returned by the function localeconv should not be modified. | | ||
edges | ||
| test.c:5:18:5:22 | c_str | test.c:8:8:8:12 | c_str | | ||
| test.c:15:16:15:21 | call to getenv | test.c:21:9:21:12 | env1 | | ||
| test.c:21:9:21:12 | env1 | test.c:5:18:5:22 | c_str | | ||
| test.c:61:11:61:20 | call to localeconv | test.c:64:5:64:9 | conv4 | | ||
| test.c:69:25:69:34 | call to localeconv | test.c:73:5:73:8 | conv | | ||
| test.c:8:18:8:22 | c_str | test.c:11:8:11:12 | c_str | | ||
| test.c:18:16:18:21 | call to getenv | test.c:24:9:24:12 | env1 | | ||
| test.c:24:9:24:12 | env1 | test.c:8:18:8:22 | c_str | | ||
| test.c:64:11:64:20 | call to localeconv | test.c:67:5:67:9 | conv4 | | ||
| test.c:72:25:72:34 | call to localeconv | test.c:76:5:76:8 | conv | | ||
nodes | ||
| test.c:5:18:5:22 | c_str | semmle.label | c_str | | ||
| test.c:8:8:8:12 | c_str | semmle.label | c_str | | ||
| test.c:15:16:15:21 | call to getenv | semmle.label | call to getenv | | ||
| test.c:21:9:21:12 | env1 | semmle.label | env1 | | ||
| test.c:61:11:61:20 | call to localeconv | semmle.label | call to localeconv | | ||
| test.c:64:5:64:9 | conv4 | semmle.label | conv4 | | ||
| test.c:69:25:69:34 | call to localeconv | semmle.label | call to localeconv | | ||
| test.c:73:5:73:8 | conv | semmle.label | conv | | ||
| test.c:8:18:8:22 | c_str | semmle.label | c_str | | ||
| test.c:11:8:11:12 | c_str | semmle.label | c_str | | ||
| test.c:18:16:18:21 | call to getenv | semmle.label | call to getenv | | ||
| test.c:24:9:24:12 | env1 | semmle.label | env1 | | ||
| test.c:64:11:64:20 | call to localeconv | semmle.label | call to localeconv | | ||
| test.c:67:5:67:9 | conv4 | semmle.label | conv4 | | ||
| test.c:72:25:72:34 | call to localeconv | semmle.label | call to localeconv | | ||
| test.c:76:5:76:8 | conv | semmle.label | conv | | ||
subpaths |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
c/common/test/rules/functionlikemacrosdefined/FunctionLikeMacrosDefined.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
| test.c:8:1:8:25 | #define MACRO4(x) (x + 1) | Macro used instead of a function. | | ||
| test.c:13:1:13:48 | #define MACRO9() printf_custom("output = %d", 7) | Macro used instead of a function. | |
4 changes: 4 additions & 0 deletions
4
c/common/test/rules/functionlikemacrosdefined/FunctionLikeMacrosDefined.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// GENERATED FILE - DO NOT MODIFY | ||
import codingstandards.cpp.rules.functionlikemacrosdefined.FunctionLikeMacrosDefined | ||
|
||
class TestFileQuery extends FunctionLikeMacrosDefinedSharedQuery, TestQuery { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND | ||
// CHANGES SHOULD BE REFLECTED THERE AS WELL. | ||
#include <assert.h> | ||
|
||
#define MACRO(OP, L, R) ((L)OP(R)) // COMPLIANT | ||
#define MACRO2(L, R) (L + R) // COMPLIANT | ||
#define MACRO3(L, R) (L " " R " " L) // COMPLIANT | ||
#define MACRO4(x) (x + 1) // NON_COMPLIANT | ||
#define MACRO5(L, LR) (LR + 1) // COMPLIANT | ||
#define MACRO6(x) printf_custom("output = %d", test##x) // COMPLIANT | ||
#define MACRO7(x) #x // COMPLIANT | ||
#define MACRO8(x) "NOP" // COMPLIANT | ||
#define MACRO9() printf_custom("output = %d", 7) // NON_COMPLIANT | ||
#define MACRO10(x) // COMPLIANT | ||
#define MY_ASSERT(X) assert(X) // NON_COMPLIANT[FALSE_NEGATIVE] | ||
|
||
char a1[MACRO2(1, 1) + 6]; | ||
extern int printf_custom(char *, int); | ||
int test1; | ||
|
||
void f() { | ||
int i = MACRO(+, 1, 1); | ||
int i2 = MACRO2(7, 10); | ||
|
||
static int i3 = MACRO2(1, 1); | ||
|
||
char *i4 = MACRO3("prefix", "suffix"); | ||
|
||
int i5 = MACRO4(1); | ||
|
||
int i6 = MACRO4(MACRO2(1, 1)); | ||
|
||
int i7 = MACRO5(1, 1); | ||
|
||
MACRO6(1); | ||
|
||
char *i10 = MACRO7("prefix"); | ||
|
||
asm(MACRO8(1)); | ||
|
||
MY_ASSERT(1); | ||
} |
3 changes: 3 additions & 0 deletions
3
...ules/gotoreferencealabelinsurroundingblock/GotoReferenceALabelInSurroundingBlock.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
| test.c:4:3:4:10 | goto ... | The goto statement and its $@ are not declared or enclosed in the same block. | test.c:6:3:6:5 | label ...: | label | | ||
| test.c:42:3:42:10 | goto ... | The goto statement and its $@ are not declared or enclosed in the same block. | test.c:46:3:46:5 | label ...: | label | | ||
| test.c:57:5:57:12 | goto ... | The goto statement and its $@ are not declared or enclosed in the same block. | test.c:60:3:60:5 | label ...: | label | |
4 changes: 4 additions & 0 deletions
4
...test/rules/gotoreferencealabelinsurroundingblock/GotoReferenceALabelInSurroundingBlock.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// GENERATED FILE - DO NOT MODIFY | ||
import codingstandards.cpp.rules.gotoreferencealabelinsurroundingblock.GotoReferenceALabelInSurroundingBlock | ||
|
||
class TestFileQuery extends GotoReferenceALabelInSurroundingBlockSharedQuery, TestQuery { } |
2 changes: 2 additions & 0 deletions
2
c/misra/test/rules/RULE-15-3/test.c → ...oreferencealabelinsurroundingblock/test.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
c/common/test/rules/gotostatementcondition/GotoStatementCondition.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
| test.c:5:3:5:10 | goto ... | The $@ statement jumps to a $@ that is not declared later in the same function. | test.c:5:3:5:10 | goto ... | L1 | test.c:2:1:2:3 | label ...: | label ...: | | ||
| test.c:14:3:14:10 | goto ... | The $@ statement jumps to a $@ that is not declared later in the same function. | test.c:14:3:14:10 | goto ... | L2 | test.c:12:1:12:3 | label ...: | label ...: | | ||
| test.c:16:3:16:10 | goto ... | The $@ statement jumps to a $@ that is not declared later in the same function. | test.c:16:3:16:10 | goto ... | L1 | test.c:11:1:11:3 | label ...: | label ...: | | ||
| test.c:9:3:9:10 | goto ... | The $@ statement jumps to a $@ that is not declared later in the same function. | test.c:9:3:9:10 | goto ... | l1 | test.c:5:1:5:3 | label ...: | label ...: | | ||
| test.c:21:3:21:10 | goto ... | The $@ statement jumps to a $@ that is not declared later in the same function. | test.c:21:3:21:10 | goto ... | l2 | test.c:17:1:17:3 | label ...: | label ...: | | ||
| test.c:23:3:23:10 | goto ... | The $@ statement jumps to a $@ that is not declared later in the same function. | test.c:23:3:23:10 | goto ... | l1 | test.c:16:1:16:3 | label ...: | label ...: | | ||
| test.c:28:3:28:10 | goto ... | The $@ statement jumps to a $@ that is not declared later in the same function. | test.c:28:3:28:10 | goto ... | l1 | test.c:27:1:27:3 | label ...: | label ...: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
void f1() { | ||
L1:; | ||
goto L2; // COMPLIANT | ||
; | ||
goto L1; // NON_COMPLIANT | ||
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND | ||
// CHANGES SHOULD BE REFLECTED THERE AS WELL. | ||
void f1(int p1) { | ||
|
||
L2:; | ||
l1: | ||
if (p1) { | ||
goto l2; // COMPLIANT | ||
} | ||
goto l1; // NON_COMPLIANT | ||
|
||
l2:; | ||
} | ||
|
||
void f2() { | ||
L1:; | ||
L2: | ||
goto L3; // COMPLIANT | ||
goto L2; // NON_COMPLIANT | ||
L3: | ||
goto L1; // NON_COMPLIANT | ||
void f2(int p1) { | ||
|
||
l1:; | ||
l2: | ||
if (p1) { | ||
goto l3; // COMPLIANT | ||
} | ||
goto l2; // NON_COMPLIANT | ||
l3: | ||
goto l1; // NON_COMPLIANT | ||
} | ||
|
||
void f3() { | ||
l1: | ||
goto l1; // NON_COMPLIANT | ||
} |
1 change: 1 addition & 0 deletions
1
c/common/test/rules/gotostatementshouldnotbeused/GotoStatementShouldNotBeUsed.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
| test.c:6:3:6:14 | goto ... | Use of goto. | |
4 changes: 4 additions & 0 deletions
4
c/common/test/rules/gotostatementshouldnotbeused/GotoStatementShouldNotBeUsed.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// GENERATED FILE - DO NOT MODIFY | ||
import codingstandards.cpp.rules.gotostatementshouldnotbeused.GotoStatementShouldNotBeUsed | ||
|
||
class TestFileQuery extends GotoStatementShouldNotBeUsedSharedQuery, TestQuery { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND | ||
// CHANGES SHOULD BE REFLECTED THERE AS WELL. | ||
void test_goto() { | ||
int x = 1; | ||
|
||
goto label1; // NON_COMPLIANT | ||
|
||
label1: | ||
|
||
x = 2; | ||
} |
12 changes: 6 additions & 6 deletions
12
c/common/test/rules/invalidatedenvstringpointers/InvalidatedEnvStringPointers.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
| test.c:19:14:19:19 | tmpvar | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:11:12:11:17 | call to getenv | call to getenv | test.c:15:13:15:18 | call to getenv | call to getenv | | ||
| test.c:132:14:132:17 | temp | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:128:12:128:17 | call to getenv | call to getenv | test.c:129:11:129:16 | call to getenv | call to getenv | | ||
| test.c:132:20:132:22 | tmp | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:129:11:129:16 | call to getenv | call to getenv | test.c:128:12:128:17 | call to getenv | call to getenv | | ||
| test.c:163:14:163:26 | tmpvar_global | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:155:19:155:24 | call to getenv | call to getenv | test.c:159:20:159:25 | call to getenv | call to getenv | | ||
| test.c:186:18:186:18 | r | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:183:7:183:15 | call to setlocale | call to setlocale | test.c:185:8:185:17 | call to localeconv | call to localeconv | | ||
| test.c:206:10:206:15 | tmpvar | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:200:12:200:17 | call to getenv | call to getenv | test.c:204:3:204:8 | call to f11fun | call to f11fun | | ||
| test.c:21:14:21:19 | tmpvar | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:13:12:13:17 | call to getenv | call to getenv | test.c:17:13:17:18 | call to getenv | call to getenv | | ||
| test.c:134:14:134:17 | temp | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:130:12:130:17 | call to getenv | call to getenv | test.c:131:11:131:16 | call to getenv | call to getenv | | ||
| test.c:134:20:134:22 | tmp | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:131:11:131:16 | call to getenv | call to getenv | test.c:130:12:130:17 | call to getenv | call to getenv | | ||
| test.c:165:14:165:26 | tmpvar_global | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:157:19:157:24 | call to getenv | call to getenv | test.c:161:20:161:25 | call to getenv | call to getenv | | ||
| test.c:188:18:188:18 | r | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:185:7:185:15 | call to setlocale | call to setlocale | test.c:187:8:187:17 | call to localeconv | call to localeconv | | ||
| test.c:208:10:208:15 | tmpvar | This pointer was returned by a $@ and may have been overwritten by the susequent $@. | test.c:202:12:202:17 | call to getenv | call to getenv | test.c:206:3:206:8 | call to f11fun | call to f11fun | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...mon/test/rules/invalidatedenvstringpointerswarn/InvalidatedEnvStringPointersWarn.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
| test.c:13:19:13:24 | call to getenv | The value of variable $@ might become invalid after a subsequent call to function `getenv`. | test.c:10:7:10:19 | tmpvar_global | tmpvar_global | | ||
| test.c:16:20:16:25 | call to getenv | The value of variable $@ might become invalid after a subsequent call to function `getenv`. | test.c:7:9:7:20 | tmpvar_field | tmpvar_field | | ||
| test.c:15:19:15:24 | call to getenv | The value of variable $@ might become invalid after a subsequent call to function `getenv`. | test.c:12:7:12:19 | tmpvar_global | tmpvar_global | | ||
| test.c:18:20:18:25 | call to getenv | The value of variable $@ might become invalid after a subsequent call to function `getenv`. | test.c:9:9:9:20 | tmpvar_field | tmpvar_field | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
c/common/test/rules/lowercaselstartsinliteralsuffix/LowercaseLStartsInLiteralSuffix.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
| test.c:5:10:5:11 | 0 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:6:10:6:12 | 0 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:9:10:9:12 | 0 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:10:10:10:12 | 0 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:15:11:15:12 | 0 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:16:11:16:13 | 0 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:19:11:19:13 | 0 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:20:11:20:13 | 0 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:25:10:25:14 | 1 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:26:10:26:15 | 1 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:29:10:29:15 | 1 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:30:10:30:15 | 1 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:35:11:35:14 | 1 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:36:11:36:15 | 1 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:39:11:39:15 | 1 | Lowercase 'l' used as a literal suffix. | | ||
| test.c:40:11:40:15 | 1 | Lowercase 'l' used as a literal suffix. | |
4 changes: 4 additions & 0 deletions
4
c/common/test/rules/lowercaselstartsinliteralsuffix/LowercaseLStartsInLiteralSuffix.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// GENERATED FILE - DO NOT MODIFY | ||
import codingstandards.cpp.rules.lowercaselstartsinliteralsuffix.LowercaseLStartsInLiteralSuffix | ||
|
||
class TestFileQuery extends LowercaseLStartsInLiteralSuffixSharedQuery, TestQuery { } |
Oops, something went wrong.