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

shadowing errors (function arguments shadow other functions' names) on gcc 4.9

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 5.14.0
    • None

    Description

      I'm trying to build Qt 5.14 on Debian 8 PPC 64-bit big-endian (I haven't done that since 5.12) and got these errors:

      CCACHE_SLOPPINESS="pch_defines,time_macros${CCACHE_SLOPPINESS+,$CCACHE_SLOPPINESS}" CCACHE_CPP2=true ccache g++ -c -pipe -g -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wvla -Wno-missing-field-initializers -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -Wno-error=strict-overflow -D_REENTRANT -fPIC -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DELF_INTERPRETER=\"/lib/ld.so.1\" -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DPCRE2_CODE_UNIT_WIDTH=16 -Wall -Wextra -Werror -Woverloaded-virtual -Wshadow -Wundef -Wfloat-equal -Wnon-virtual-dtor -Wpointer-arith -Wformat-security -Wno-long-long -Wno-variadic-macros -pedantic-errors -Wchar-subscripts -Wold-style-cast -Wcast-align -Wdouble-promotion -Wfloat-conversion -Wzero-as-null-pointer-constant -I/home/rutledge/dev/qt514/qtbase/src/corelib -I. -Iglobal -I/home/rutledge/dev/qt514/qtbase/src/3rdparty/md5 -I/home/rutledge/dev/qt514/qtbase/src/3rdparty/md4 -I/home/rutledge/dev/qt514/qtbase/src/3rdparty/sha3 -I/home/rutledge/dev/qt514/qtbase/src/3rdparty -I/home/rutledge/dev/qt514/qtbase/src/3rdparty/double-conversion/include -I/home/rutledge/dev/qt514/qtbase/src/3rdparty/harfbuzz/src -I/home/rutledge/dev/qt514/qtbase/src/3rdparty/forkfd -I/home/rutledge/dev/qt514/qtbase/src/3rdparty/tinycbor/src -I../../include -I../../include/QtCore -I../../include/QtCore/5.14.1 -I../../include/QtCore/5.14.1/QtCore -I.moc -I.tracegen -I/home/rutledge/dev/qt514/qtbase/src/3rdparty/pcre2/src -isystem /usr/include/glib-2.0 -I/usr/lib/powerpc-linux-gnu/glib-2.0/include -I/home/rutledge/dev/qt514/qtbase/mkspecs/linux-g++ -DQT_NO_CAST_TO_ASCII=1 -DQT_NO_CAST_FROM_ASCII=1 -UQT_RESTRICTED_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_URL_CAST_FROM_STRING=1 -DQT_NO_CAST_FROM_BYTEARRAY=1 -DQT_NO_KEYWORDS=1 -DQT_USE_QSTRINGBUILDER -DQT_USE_FAST_OPERATOR_PLUS -Dsignals=int -Dslots=int -Demit=public: -Dforeach=public: -Dforever=public: -xc++ /home/rutledge/dev/qt514/qtbase/src/corelib/animation/qabstractanimation.h -o .obj/header_qabstractanimation.o
      In file included from ../../include/QtCore/qvector.h:1:0,
                       from ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qlist.h:48,
                       from ../../include/QtCore/qlist.h:1,
                       from ../../include/QtCore/../../../../qt514/qtbase/src/corelib/kernel/qobject.h:49,
                       from ../../include/QtCore/qobject.h:1,
                       from /home/rutledge/dev/qt514/qtbase/src/corelib/animation/qabstractanimation.h:43:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qvector.h: In constructor ‘QVector<T>::QVector(InputIterator, InputIterator)’:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qvector.h:574:60: error: declaration of ‘last’ shadows a member of 'this' [-Werror=shadow]
       QVector<T>::QVector(InputIterator first, InputIterator last)
                                                                  ^
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qvector.h:574:60: error: declaration of ‘first’ shadows a member of 'this' [-Werror=shadow]
      In file included from ../../include/QtCore/qlist.h:1:0,
                       from ../../include/QtCore/../../../../qt514/qtbase/src/corelib/kernel/qobject.h:49,
                       from ../../include/QtCore/qobject.h:1,
                       from /home/rutledge/dev/qt514/qtbase/src/corelib/animation/qabstractanimation.h:43:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qlist.h: In constructor ‘QList<T>::QList(InputIterator, InputIterator)’:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qlist.h:862:56: error: declaration of ‘last’ shadows a member of 'this' [-Werror=shadow]
       QList<T>::QList(InputIterator first, InputIterator last)
                                                              ^
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qlist.h:862:56: error: declaration of ‘first’ shadows a member of 'this' [-Werror=shadow]
      In file included from ../../include/QtCore/qstringlist.h:1:0,
                       from ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qlist.h:1179,
                       from ../../include/QtCore/qlist.h:1,
                       from ../../include/QtCore/../../../../qt514/qtbase/src/corelib/kernel/qobject.h:49,
                       from ../../include/QtCore/qobject.h:1,
                       from /home/rutledge/dev/qt514/qtbase/src/corelib/animation/qabstractanimation.h:43:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/text/qstringlist.h: In constructor ‘QStringList::QStringList(InputIterator, InputIterator)’:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/text/qstringlist.h:122:9: error: declaration of ‘last’ shadows a member of 'this' [-Werror=shadow]
               : QList<QString>(first, last) { }
               ^
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/text/qstringlist.h:122:9: error: declaration of ‘first’ shadows a member of 'this' [-Werror=shadow]
      In file included from ../../include/QtCore/qvarlengtharray.h:1:0,
                       from ../../include/QtCore/../../../../qt514/qtbase/src/corelib/kernel/qmetatype.h:48,
                       from ../../include/QtCore/qmetatype.h:1,
                       from ../../include/QtCore/../../../../qt514/qtbase/src/corelib/kernel/qobject.h:54,
                       from ../../include/QtCore/qobject.h:1,
                       from /home/rutledge/dev/qt514/qtbase/src/corelib/animation/qabstractanimation.h:43:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qvarlengtharray.h: In constructor ‘QVarLengthArray<T, Prealloc>::QVarLengthArray(InputIterator, InputIterator)’:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qvarlengtharray.h:81:9: error: declaration of ‘last’ shadows a member of 'this' [-Werror=shadow]
               : QVarLengthArray()
               ^
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qvarlengtharray.h:81:9: error: declaration of ‘first’ shadows a member of 'this' [-Werror=shadow]
      In file included from ../../include/QtCore/qlist.h:1:0,
                       from ../../include/QtCore/../../../../qt514/qtbase/src/corelib/kernel/qobject.h:49,
                       from ../../include/QtCore/qobject.h:1,
                       from /home/rutledge/dev/qt514/qtbase/src/corelib/animation/qabstractanimation.h:43:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qlist.h: In instantiation of ‘QList<T>::QList(InputIterator, InputIterator) [with InputIterator = const QString*; typename std::enable_if<std::is_convertible<typename std::iterator_traits<_InIterator>::iterator_category, std::input_iterator_tag>::value, bool>::type <anonymous> = 1u; T = QString]’:
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qlist.h:170:41:   required from ‘QList<T>::QList(std::initializer_list<_Tp>) [with T = QString]’
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/text/qstringlist.h:119:82:   required from here
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qlist.h:862:1: error: declaration of ‘last’ shadows a member of 'this' [-Werror=shadow]
       QList<T>::QList(InputIterator first, InputIterator last)
       ^
      ../../include/QtCore/../../../../qt514/qtbase/src/corelib/tools/qlist.h:862:1: error: declaration of ‘first’ shadows a member of 'this' [-Werror=shadow]
      cc1plus: all warnings being treated as errors
      Makefile:2035: recipe for target '.obj/header_qabstractanimation.o' failed
      

      gcc --version says gcc (Debian 4.9.2-10+deb8u1) 4.9.2

      (Upgrading to Debian sid makes this go away; but we say that we still support GCC 4.9: https://doc.qt.io/qt-5.14/supported-platforms.html Debian big-endian PPC doesn't have any more official releases after Debian 8, so going with sid is the easiest way to get a newer compiler.)

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes