File tree 1 file changed +6
-6
lines changed
c/misra/test/rules/DIR-4-15
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -162,8 +162,8 @@ void f1(float p1) {
162
162
(int )pow (2 , sin (p1 )); // COMPLIANT: not likely to be Infinity
163
163
(int )(1 /
164
164
sin (p1 )); // NON_COMPLIANT: possible infinity from zero in denominator
165
- (int )(1 / log (p1 )); // COMPLIANT: not possibly zero in denominator
166
- (int )pow (p1 , p1 ); // NON_COMPLIANT: NaN if p1 is zero
165
+ (int )(1 / log (p1 )); // COMPLIANT: not possibly zero in denominator
166
+ (int )pow (p1 , p1 ); // NON_COMPLIANT: NaN if p1 is zero
167
167
if (p1 != 0 ) {
168
168
(int )pow (p1 , p1 ); // COMPLIANT: p1 is not zero
169
169
}
@@ -193,10 +193,10 @@ void f2() {
193
193
castToInt (1.0 /
194
194
0.0 ); // NON_COMPLIANT: Infinity flows to denominator in division
195
195
castToInt (0.0 / 0.0 ); // NON_COMPLIANT: NaN flows to denominator in division
196
- checkBeforeCastToInt (1.0 / 0.0 ); // COMPLIANT
197
- checkBeforeCastToInt (0.0 / 0.0 ); // COMPLIANT
198
- addOneThenCastToInt (1.0 / 0.0 ); // NON_COMPLIANT[False negative]
199
- addOneThenCastToInt (0.0 / 0.0 ); // NON_COMPLIANT
196
+ checkBeforeCastToInt (1.0 / 0.0 ); // COMPLIANT
197
+ checkBeforeCastToInt (0.0 / 0.0 ); // COMPLIANT
198
+ addOneThenCastToInt (1.0 / 0.0 ); // NON_COMPLIANT[False negative]
199
+ addOneThenCastToInt (0.0 / 0.0 ); // NON_COMPLIANT
200
200
castToIntToFloatToInt (1.0 / 0.0 ); // NON_COMPLIANT
201
201
castToIntToFloatToInt (0.0 / 0.0 ); // NON_COMPLIANT
202
202
You can’t perform that action at this time.
0 commit comments