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

QBasicAtomicInteger<qint64> support missing for MSVC

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.2.0
    • None
    • Core: Other, Core: Threads
    • None
    • MSVS 2012, Windows 7
    • 1b3a424bcf5948aefd72e514cf40662deeabbe30

    Description

      This is something PCLint is complaining about and I agree with it.

      QBasicAtomicInt is based on a 'volatile int' _q_value type. This cascades through several layers of files and templates into QAtomicOps<int> (qbasicatomic.h:134). QAtomicOps is an interface template definition that is built on QAtomicOpsBySize, which has 1 specialization for size 4. This all works very well on 32-bit machines (size=4), but on a 64-bit machine the int will most likely be defined as 64-bit and thus have a size=8.

      PCLint is complaining that (qbasicatomic.h:138) typename Ops::Type _q_value; is not defined on 64-bit systems and I have to agree.

      So please, either make the QBasicAtomicInt use a 'volatile long' or 'volatile qint32' to fix it to 32 bit OR supply an implementation of QAtomicOpsBySize<8>.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            wathiant Job Mulder
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes