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

Inconsistent hashing between qint{32,64} on 32-bit platforms

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.0 FF
    • 6.5.2, 6.6.0 Beta2, dev
    • None
    • Ubuntu 20.04, Clang 15, GCC 11, GCC 9
    • c86cf385d (dev), 2d4db1bff (6.5), 3a9bbf235 (6.6), 1845d4332 (dev), 1d7950c94 (dev), 0d15c000a (dev), c4aa3b0dc (6.7)

    Description

      Besides QTBUG-116076, and QTBUG-116077, which are probably still fixable before Qt 7, we also have that

      • qHash(-42),
      • qHash(-42LL)

      produce different values, because we fold the upper half of the 64-bit word onto the lower half in a way that doesn't work with two's complement signed integers (it works just fine for unsigned integers).

      Expectation would be, like in the epic, that equal values produce equal hash values.

      This doesn't look fixable in Qt 6, as the qint32 and qint64 overloads are both inline, therefore immutable.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: