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

qflags.h inline conversion of long to int for QFlag constructor broken; fails compile PyQt on OSX 64 bit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.3.0 Beta1
    • Core: Other
    • None
    • OSX 10.9, Qt5.3.1, latest PyQt
    • macOS

    Description

      Compiling PyQt on OSX yields compile error:

      /Users/bootch/Downloads/PyQt-gpl-5.2.1/sip/QtCore/qglobal.sip:132:48: error: conversion from 'long' to 'QFlag'
      is ambiguous
      *sipCppPtr = new QByteArray::Base64Options(SIPLong_AsLong(sipPy));
      /Users/bootch/qt5/qtbase/lib/QtCore.framework/Headers/qflags.h:60:29: note: candidate constructor
      Q_DECL_CONSTEXPR inline QFlag(int ai) : i(ai) {}

      I think the compiler is looking for a QFlag constructor that takes a long arg.

      qflags.h has this:

      #if !defined(_LP64_) && !defined(Q_QDOC)
      Q_DECL_CONSTEXPR inline QFlag(long ai) : i(int(ai)) {}
      Q_DECL_CONSTEXPR inline QFlag(ulong ai) : i(int(long(ai))) {}
      #endif

      Removing the first bang fixes the problem. I could be wrong, but it seems like the logic of the #if is reversed: it is on a 64-bit platform where the definition is needed, to convert from a 64-bit long argument to a 32-bit QFlag instance.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            bootchk lloyd konneker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes