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

QString::toWCharArray hits Intel diagnostic #111 statement is unreachable

    XMLWordPrintable

    Details

      Description

      when compiling with Intel Composer XE 2016 compiler on windows one encounters warning #111 on QString::toWCharArray

      Qt\5.6.1\include\QtCore/qstring.h(961): warning #111: statement is unreachable
            return toUcs4_helper(d->data(), size(), reinterpret_cast<uint *>(array));
            ^
      

      there is an attempt to suppress some Microsoft warning, but doesn't suppress ones from Intel.
      to suppress Intel's warning can add: QT_WARNING_DISABLE_INTEL(111) // "statement is unreachable"

      QT_WARNING_PUSH
      QT_WARNING_DISABLE_MSVC(4127)   // "conditional expression is constant"
      
      inline int QString::toWCharArray(wchar_t *array) const
      {
          if (sizeof(wchar_t) == sizeof(QChar)) {
              memcpy(array, d->data(), sizeof(QChar) * size());
              return size();
          }
          return toUcs4_helper(d->data(), size(), reinterpret_cast<uint *>(array));
      }
      
      QT_WARNING_POP
      

        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:
            warnold Wayne Arnold
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes