Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57649

Add -Wfloat-equal flag generate some warnings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 5.7.1
    • Fix Version/s: 5.9.0 Beta 2
    • Component/s: Core: Other
    • Labels:
      None
    • Commits:
      e7295c959b73cec09e36d3703d5619e8e7aa5fb1

      Description

      Hi,
      If I add the following flag into my pro file:

      QMAKE_CXXFLAGS += -Wfloat-equal
      

      I get a number of warnings about float comparison with == in Qt code in following classes:

      • QTransform
      • QRectF
      • QVector2D

      Typical example:

      Q_DECL_CONSTEXPR inline bool operator==(const QVector2D &v1, const QVector2D &v2)
      {
          return v1.xp == v2.xp && v1.yp == v2.yp;
      }
      

      I think all these comparisons should use the QFuzzy functions.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            razamut razamut
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes