Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

dev-qt/qtbase-6.9.3 doesn't get on with clang

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
Goverp
Advocate
Advocate
User avatar
Posts: 2402
Joined: Wed Mar 07, 2007 6:41 pm

dev-qt/qtbase-6.9.3 doesn't get on with clang

  • Quote

Post by Goverp » Mon Jan 05, 2026 12:31 pm

For info, I've just posted a bug:
Using clang version 21.1.8 (and I assume earlier versions), kde-misc/kdeconnect-25.08.3-r1 & app-office/kmymoney-5.2.1-r2 won't compile. They produce the following messages in the build log:

Code: Select all

In file included from /usr/include/qt6/QtCore/qdebug.h:41:
/usr/include/qt6/QtCore/qlist.h:449:26: error: constexpr variable 'MaxSize' must be initialized by a constant expression
  449 |         constexpr size_t MaxSize = maxSize()
They compile OK with gcc.
Greybeard
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Mon Jan 05, 2026 1:11 pm

Its 'flexible' coding in Qt6 Qlist.
If you insist on playing around a bit and not use GCC then you can try

Code: Select all

cp /usr/include/qt6/QtCore/qlist.h /usr/include/qt6/QtCore/qlist.h.bak
grep MaxSize  /usr/include/qt6/QtCore/qlist.h 
Then you can modify

Code: Select all

constexpr size_t MaxSize = maxSize();

to

Code: Select all

static const size_t MaxSize = maxSize();
Emerge the packages and then revert to the original header.
Or create a patch for qlist.h
This is just for fun.
Not a permanent workaround :)
Clang is behaving a bit bitchy.
Like a mean nanny.
Gcc seems more forgiving...
:)
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Mon Jan 05, 2026 3:19 pm

6.9.3 has been dropped from Gentoo's repository, you should probably check if it still happens with current stable, 6.10.1.

Looking at QtBase's current code in its Git repository, I can't see why QList<T>::maxSize() wouldn't be a C++ constant expression for every T.
NeddySeagoon wrote:I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Top
Goverp
Advocate
Advocate
User avatar
Posts: 2402
Joined: Wed Mar 07, 2007 6:41 pm

  • Quote

Post by Goverp » Tue Jan 06, 2026 10:26 am

GDH-gentoo wrote:6.9.3 has been dropped from Gentoo's repository, you should probably check if it still happens with current stable, 6.10.1.
I wonder if there's some dependency sequencing issue here. I was running the emerge --update yesterday after syncing, so if 6.10.1 is latest, why was (AFAIR) the listing showing the earlier version? I guess it was left from my precious update probably a couple of weeks ago. I'm on the wrong machine to check at the moment - maybe something else is screwed here.
Greybeard
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Sat Jan 24, 2026 3:49 pm

So I'm curious, does it happen for 6.10.1? What I see is:

src/corelib/tools/qcontainerfwd.h

Code: Select all

namespace QtPrivate
{
[[maybe_unused]]
constexpr qsizetype MaxAllocSize = (std::numeric_limits<qsizetype>::max)();
}
src/corelib/tools/qarraydata.h

Code: Select all

#include <QtCore/qcontainerfwd.h>
//...
template <class T>
struct QTypedArrayData
    : QArrayData
{
    //...
    constexpr static qsizetype maxSize() noexcept
    {
        // -1 to deal with the pointer one-past-the-end
        return (QtPrivate::MaxAllocSize - sizeof(QtPrivate::AlignedQArrayData) - 1) / sizeof(T);
    }
    //...
};
src/corelib/tools/qarraydataops.h

Code: Select all

#include <QtCore/qarraydata.h>
src/corelib/tools/qarraydatapointer.h

Code: Select all

#include <QtCore/qarraydataops.h>
src/corelib/tools/qlist.h

Code: Select all

#include <QtCore/qarraydatapointer.h>
//...
template <typename T>
class QList
#ifndef Q_QDOC
    : public QListSpecialMethods<T>
#endif
{
    using Data = QTypedArrayData<T>;
    //...
    using DataPointer = QArrayDataPointer<T>;
    //...
    DataPointer d;
public:
    //...
    static constexpr qsizetype maxSize() { return Data::maxSize(); }
    constexpr qsizetype size() const noexcept
    {
        constexpr size_t MaxSize = maxSize();
        Q_PRESUME(size_t(d.size) <= MaxSize);
        return d.size;
    //...
};
And MaxSize's initializer looks like a constant expression to me (QList<T>::maxSize() and QList<T>::Data::maxSize() a.k.a. QTypedArrayData<T>::maxSize() are constexpr member functions, sizeof expressions are constant expressions, and AFAIK QtPrivate::MaxAllocSize is a variable usable in constant expressions)...
NeddySeagoon wrote:I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Top
Post Reply

5 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy