Skip to content

Commit 94bad29

Browse files
Format
1 parent 642c737 commit 94bad29

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

c/misra/src/rules/RULE-21-23/TgMathArgumentsWithDifferingStandardType.ql

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ string argTypesString(TgMathInvocation call, int i) {
2929

3030
/**
3131
* If the range of values can be represented as a signed int, it is promoted to signed int.
32-
*
32+
*
3333
* A value may also promote to unsigned int but only if `int` cannot represent the range of
3434
* values. Which basically means only an `unsigned int` promotes to `unsigned int`, so we don't
3535
* need to do anything in this case.
36-
*
36+
*
3737
* An unsigned int bitfield with fewer than 32 bits is promoted to `int`.
3838
*/
3939
predicate promotesToSignedInt(Expr e) {
@@ -47,6 +47,7 @@ predicate promotesToSignedInt(Expr e) {
4747
)
4848
)
4949
}
50+
5051
Type getPromotedType(Expr e) {
5152
if promotesToSignedInt(e) then result.(IntType).isSigned() else result = e.getUnderlyingType()
5253
}

0 commit comments

Comments
 (0)