Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e092ae

Browse files
committed
CPP: Tag LossyFunctionResultCast.ql. Will be run on LGTM.
1 parent bd9a2d7 commit 0e092ae

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cpp/ql/src/Likely Bugs/Conversion/LossyFunctionResultCast.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/**
22
* @name Lossy function result cast
33
* @description Finds function calls whose result type is a floating point type, and which are casted to an integral type.
4-
* Includes only expressions with implicit cast and excludes function calls to ceil, floor and round. {This is a gcc check; doesn't seem wildly useful.}
4+
* Includes only expressions with implicit cast and excludes function calls to ceil, floor and round.
55
* @kind problem
66
* @id cpp/lossy-function-result-cast
77
* @problem.severity warning
8+
* @precision medium
9+
* @tags correctness
810
*/
911
import cpp
1012

@@ -15,4 +17,4 @@ where t1 = c.getTarget().getType().getUnderlyingType() and
1517
not c.getTarget().getName() = "ceil" and
1618
not c.getTarget().getName() = "floor" and
1719
not c.getTarget().getName() = "round"
18-
select c
20+
select c, "Return value of type " + t1.toString() + " is implicitly converted to " + t2.toString() + " here."

0 commit comments

Comments
 (0)