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
Copy file name to clipboardExpand all lines: cpp/ql/src/Likely Bugs/Conversion/LossyFunctionResultCast.ql
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
/**
2
2
* @name Lossy function result cast
3
3
* @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.
5
5
* @kind problem
6
6
* @id cpp/lossy-function-result-cast
7
7
* @problem.severity warning
8
+
* @precision medium
9
+
* @tags correctness
8
10
*/
9
11
import cpp
10
12
@@ -15,4 +17,4 @@ where t1 = c.getTarget().getType().getUnderlyingType() and
15
17
notc.getTarget().getName()="ceil"and
16
18
notc.getTarget().getName()="floor"and
17
19
notc.getTarget().getName()="round"
18
-
selectc
20
+
selectc,"Return value of type "+t1.toString()+" is implicitly converted to "+t2.toString()+" here."
0 commit comments