Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Clang goes crazy?



  • Hello.
    I moved to Qt6 and QtCreator is current. All is well and works however Clang disappoints.

    In Qt5 it kept telling me, that all the signals from QAction are not actually signals and kept putting lots of yellow warnings. Then some update came and it went away.
    Today there is something else and honestly I don't know it that should be reported somewhere or what.

    I had const QStringList animext = {".gif",".giff",".webp"}; and Clang started to complain that I should use QVector instead. "OK", I thought, "whatever, doesn't matter". And so I corrected to QVector, as asked.
    And then:
    d5264d06-5608-4235-9ba1-04702a56eb9d-image.png

    Is there a way to sanitise Clang warnings? I'd rather not turn them off, they're mostly useful.
    Or is there in this warning something inherently deep structure-wise and I am too stupid to comprehend?


  • Lifetime Qt Champion

    Simply disable this check for clazy in the analyzer settings.
    CLazy does not know if it's Qt5 or Qt6. In Qt5 QList was not optimal, in Qt6 QVector was renamed to QList ... maybe the next clazy version can somehow fiddle out what Qt version it's currently checking.



  • ignore some of them. If I use for loop, Clang complaints. However, no issues if foreach is used. This is not right. The reason could be g++ version is too low on Linux.



  • @JoeCFD I would but it is annoying. I am on Mac with quite a bit of processing power and other resources.


  • Lifetime Qt Champion

    Simply disable this check for clazy in the analyzer settings.
    CLazy does not know if it's Qt5 or Qt6. In Qt5 QList was not optimal, in Qt6 QVector was renamed to QList ... maybe the next clazy version can somehow fiddle out what Qt version it's currently checking.


Log in to reply