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

Add -Wfloat-equal flag generate some warnings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.9.0 Beta 2
    • 5.7.1
    • Core: Other
    • None
    • 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

        For Gerrit Dashboard: QTBUG-57649
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            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