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

Generated SourceAPI class can't be used without compiler warnings

    XMLWordPrintable

Details

    • acd888220b (qt/qtremoteobjects/dev) 79da0edb97 (qt/qtremoteobjects/6.3) a4155f2d0e (qt/qtremoteobjects/6.4) 79da0edb97 (qt/tqtc-qtremoteobjects/6.3) a4155f2d0e (qt/tqtc-qtremoteobjects/6.4) acd888220b (qt/tqtc-qtremoteobjects/dev)

    Description

      When generating code for a replica source, it also generates a SourceAPI template class.

      Trying to use this template class can result in compiler warnings and by that can't compile with -Werror.

      This only happens if no methods or no signals are provided in the rep file.

      The generated code contains the following function:

      QByteArrayList methodParameterNames(int index) const override
          {
              if (index < 0 || index >= m_methods[0])
                  return QByteArrayList();
              return ObjectType::staticMetaObject.method(m_methods[index + 1]).parameterNames();
          }
      
      ...
      
      int m_methods[1];
      

      and results in the following warning:

      warning: array subscript 1 is above array bounds of ‘const int [1][-Warray-bounds]

      Attachments

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

        Activity

          People

            bstottle Brett Stottlemyer
            gagi Dominik Holland
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes