You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "Unsigned integer expressions do not strictly overflow, but instead wrap around in a modular way. If the size of the type is not sufficient, this can happen unexpectedly.",
10
+
"kind": "problem",
11
+
"name": "Ensure that unsigned integer operations do not wrap",
"title": "Ensure that unsigned integer operations do not wrap"
22
+
},
23
+
"INT31-C": {
24
+
"properties": {
25
+
"obligation": "rule"
26
+
},
27
+
"queries": [
28
+
{
29
+
"description": "",
30
+
"kind": "problem",
31
+
"name": "Ensure that integer conversions do not result in lost or misinterpreted data",
32
+
"precision": "high",
33
+
"severity": "error",
34
+
"short_name": "IntegerConversionCausesDataLoss",
35
+
"tags": [
36
+
"correctness"
37
+
]
38
+
}
39
+
],
40
+
"title": "Ensure that integer conversions do not result in lost or misinterpreted data"
41
+
},
42
+
"INT32-C": {
43
+
"properties": {
44
+
"obligation": "rule"
45
+
},
46
+
"queries": [
47
+
{
48
+
"description": "",
49
+
"kind": "problem",
50
+
"name": "Ensure that operations on signed integers do not result in overflow",
51
+
"precision": "high",
52
+
"severity": "error",
53
+
"short_name": "SignedIntegerOverflow",
54
+
"tags": [
55
+
"correctness",
56
+
"security"
57
+
]
58
+
}
59
+
],
60
+
"title": "Ensure that operations on signed integers do not result in overflow"
61
+
},
62
+
"INT33-C": {
63
+
"properties": {
64
+
"obligation": "rule"
65
+
},
66
+
"queries": [
67
+
{
68
+
"description": "Dividing or taking the remainder by zero is undefined behavior.",
69
+
"kind": "problem",
70
+
"name": "Ensure that division and remainder operations do not result in divide-by-zero errors",
71
+
"precision": "high",
72
+
"severity": "error",
73
+
"short_name": "DivOrRemByZero",
74
+
"tags": [
75
+
"correctness"
76
+
]
77
+
}
78
+
],
79
+
"title": "Ensure that division and remainder operations do not result in divide-by-zero errors"
80
+
},
81
+
"INT35-C": {
82
+
"properties": {
83
+
"obligation": "rule"
84
+
},
85
+
"queries": [
86
+
{
87
+
"description": "",
88
+
"kind": "problem",
89
+
"name": "Use correct integer precisions",
90
+
"precision": "high",
91
+
"severity": "error",
92
+
"short_name": "UseCorrectIntegerPrecisions",
93
+
"tags": [
94
+
"correctness"
95
+
]
96
+
}
97
+
],
98
+
"title": "Use correct integer precisions"
99
+
}
100
+
},
101
+
"MISRA-C-2012": {
102
+
"RULE-12-4": {
103
+
"properties": {
104
+
"obligation": "advisory"
105
+
},
106
+
"queries": [
107
+
{
108
+
"description": "Unsigned integer expressions do not strictly overflow, but instead wrap around in a modular way. Any constant unsigned integer expressions that in effect \"overflow\" will not be detected by the compiler. Although there may be good reasons at run-time to rely on the modular arithmetic provided by unsigned integer types, the reasons for using it at compile-time to evaluate a constant expression are less obvious. Any instance of an unsigned integer constant expression wrapping around is therefore likely to indicate a programming error.",
109
+
"kind": "problem",
110
+
"name": "Evaluation of constant expressions should not lead to unsigned integer wrap-around",
Copy file name to clipboardExpand all lines: rules.csv
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -548,12 +548,12 @@ c,CERT-C,FLP32-C,Yes,Rule,,,Prevent or detect domain and range errors in math fu
548
548
c,CERT-C,FLP34-C,Yes,Rule,,,Ensure that floating-point conversions are within range of the new type,,Types,Medium,
549
549
c,CERT-C,FLP36-C,Yes,Rule,,,Preserve precision when converting integral values to floating-point type,,Types,Medium,
550
550
c,CERT-C,FLP37-C,Yes,Rule,,,Do not use object representations to compare floating-point values,,Types,Medium,
551
-
c,CERT-C,INT30-C,Yes,Rule,,,Ensure that unsigned integer operations do not wrap,A4-7-1,Types,Hard,
552
-
c,CERT-C,INT31-C,Yes,Rule,,,Ensure that integer conversions do not result in lost or misinterpreted data,A4-7-1,Types,Hard,
553
-
c,CERT-C,INT32-C,Yes,Rule,,,Ensure that operations on signed integers do not result in overflow,A4-7-1,Types,Hard,
554
-
c,CERT-C,INT33-C,Yes,Rule,,,Ensure that division and remainder operations do not result in divide-by-zero errors,,Types,Hard,
551
+
c,CERT-C,INT30-C,Yes,Rule,,,Ensure that unsigned integer operations do not wrap,A4-7-1,IntegerOverflow,Hard,
552
+
c,CERT-C,INT31-C,Yes,Rule,,,Ensure that integer conversions do not result in lost or misinterpreted data,A4-7-1,IntegerOverflow,Hard,
553
+
c,CERT-C,INT32-C,Yes,Rule,,,Ensure that operations on signed integers do not result in overflow,A4-7-1,IntegerOverflow,Hard,
554
+
c,CERT-C,INT33-C,Yes,Rule,,,Ensure that division and remainder operations do not result in divide-by-zero errors,,IntegerOverflow,Hard,
555
555
c,CERT-C,INT34-C,Yes,Rule,,,Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand,M5-8-1,Types,Import,
c,CERT-C,INT36-C,Yes,Rule,,,Converting a pointer to integer or integer to pointer,M5-2-9,Types,Easy,
558
558
c,CERT-C,MEM30-C,Yes,Rule,,,Do not access freed memory,MEM50-CPP,InvalidMemory1,Import,
559
559
c,CERT-C,MEM31-C,Yes,Rule,,,Free dynamically allocated memory when no longer needed,,Memory2,Very Hard,
@@ -685,7 +685,7 @@ c,MISRA-C-2012,RULE-11-9,Yes,Required,,,The macro NULL shall be the only permitt
685
685
c,MISRA-C-2012,RULE-12-1,Yes,Advisory,,,The precedence of operators within expressions should be made explicit,,SideEffects1,Medium,
686
686
c,MISRA-C-2012,RULE-12-2,Yes,Required,,,The right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operand,,Contracts,Medium,
687
687
c,MISRA-C-2012,RULE-12-3,Yes,Advisory,,,The comma operator should not be used,M5-18-1,Banned,Import,
688
-
c,MISRA-C-2012,RULE-12-4,Yes,Advisory,,,Evaluation of constant expressions should not lead to unsigned integer wrap-around,INT30-C,Types,Easy,
688
+
c,MISRA-C-2012,RULE-12-4,Yes,Advisory,,,Evaluation of constant expressions should not lead to unsigned integer wrap-around,INT30-C,IntegerOverflow,Easy,
689
689
c,MISRA-C-2012,RULE-12-5,Yes,Mandatory,,,The sizeof operator shall not have an operand which is a function parameter declared as �array of type�,,Types,Medium,
690
690
c,MISRA-C-2012,RULE-13-1,Yes,Required,,,Initializer lists shall not contain persistent side effects,,SideEffects1,Medium,
691
691
c,MISRA-C-2012,RULE-13-2,Yes,Required,,,The value of an expression and its persistent side effects shall be the same under all permitted evaluation orders,PRE31-C,SideEffects,Medium,
0 commit comments