From ea2777fa3e8a75239bc44ba85c8683bb2dfd7afe Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Thu, 11 Aug 2022 15:43:46 +0200 Subject: [PATCH] update {cs/cpp}/equality-on-floats to use the same alert-message/description --- cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql | 2 +- csharp/ql/src/Likely Bugs/EqualityCheckOnFloats.ql | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql b/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql index 5233f567fa5..5a2180bfaf3 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql @@ -21,4 +21,4 @@ where FloatingPointType and not ro.getAnOperand().isConstant() and // comparisons to constants generate too many false positives not left.(VariableAccess).getTarget() = right.(VariableAccess).getTarget() // skip self comparison -select ro, "Equality test on floating point values may not behave as expected." +select ro, "Equality checks on floating point values can yield unexpected results." diff --git a/csharp/ql/src/Likely Bugs/EqualityCheckOnFloats.ql b/csharp/ql/src/Likely Bugs/EqualityCheckOnFloats.ql index 1884cd5cc5f..bdf3ee4e97c 100644 --- a/csharp/ql/src/Likely Bugs/EqualityCheckOnFloats.ql +++ b/csharp/ql/src/Likely Bugs/EqualityCheckOnFloats.ql @@ -1,6 +1,8 @@ /** * @name Equality check on floating point values - * @description Equality checks on floating point values can yield unexpected results. + * @description Comparing results of floating-point computations with '==' or + * '!=' is likely to yield surprising results since floating-point + * computation does not follow the standard rules of algebra. * @kind problem * @problem.severity warning * @precision medium