I spotted the following warning for Qt classes. Can they be blacklisted ? for rule-of : QTypedArrayData::iterator, QTypedArrayData::const_iterator, QBasicTimer, QItemSelectionRange, QJsonValueRef, QPointer, QQueue, QSet, QSet::iterato, QSet::const_iterator, QtSharedPointer::ExternalRefCountDat, QEnableSharedFromThis, QStack, QStandardPaths, QStringBuilder, QXmlStreamStringRef, QMatrix, QPolygon, QPolygonF, QTextFrame::iterator, QTextBlock, QTextFragment, QTouchDevice, QTransform, a great number of QStyleOption*** classes, QStyleHintReturnMask, QStyleHintReturnVariant for function-args-by-ref : QDate, QTime, QElapsedTimer, QPoint, QPointF, QLine, QRect QSize, QSizeF , QSizePolicy, QTextItem, QTextLength, QTextOption::Tab, QVector2D, QJsonObject::iterator, QJsonObject::const_iterator, QMargins, QMetaMethod, QUuid Reproducible: Always
We can blacklist some, others we should fix in Qt. Which warning do you get with: QSizeF, and with QSize ?
Shall I report all these warnings on the qt bug tracker then ? examples of QSize and QSizef function-args-by-ref warning: ../../../../Qt/5.5/gcc_64/include/QtCore/qsize.h:134:26: warning: Pass small and trivially-copyable type by value (const class QSize &) [-Wclazy-function-args-by-ref] inline void QSize::scale(const QSize &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW ../../../../Qt/5.5/gcc_64/include/QtCore/qsize.h:299:27: warning: Pass small and trivially-copyable type by value (const class QSizeF &) [-Wclazy-function-args-by-ref] inline void QSizeF::scale(const QSizeF &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW
no need to report, I'll fix them eventually in Qt. can you use -isystem instead of -I to include Qt headers ? That will silence those warnings for you
Git commit 928ccc306223a38505a68f30ee9e81479674a336 by Sergio Martins. Committed on 18/11/2015 at 12:59. Pushed by smartins into branch 'master'. README: Explain how to suppress warnings from Qt/3rdparty headers M +6 -0 README http://commits.kde.org/clazy/928ccc306223a38505a68f30ee9e81479674a336
Thanks, but there is something I can't get right with -isystem, because I always get warnings regarding Qt classes: clang++-3.6 -stdlib=libc++ -std=c++14 -Qunused-arguments -Xclang -load -Xclang ../installclazy/lib/x86_64-linux-gnu/ClangLazy.so -Xclang -add-plugin -Xclang clang-lazy -isystem../../../../Qt/5.5/gcc_64/include/QtCore (...) -I../../../../Qt/5.5/gcc_64/include/QtCore -I. -I. -I../../../../Qt/5.5/gcc_64/mkspecs/linux-g++ -o XXX.o XXX.cpp In file included from XXX.cpp:2: In file included from ../../../../Qt/5.5/gcc_64/include/QtWidgets/QHeaderView:1: In file included from ../../../../Qt/5.5/gcc_64/include/QtWidgets/qheaderview.h:37: In file included from ../../../../Qt/5.5/gcc_64/include/QtWidgets/qabstractitemview.h:39: In file included from ../../../../Qt/5.5/gcc_64/include/QtCore/qitemselectionmodel.h:37: ../../../../Qt/5.5/gcc_64/include/QtCore/qset.h:46:1: warning: QSet has copy-ctor, copy-assignment but not dtor [-Wclazy-rule-of-three] class QSet I am using standard qmake to generate makefiles, and then invoking clazy with the following line: make -k -s "CXX=clang++-3.6 -stdlib=libc++ -std=c++14 -Qunused-arguments -Xclang -load -Xclang ../installclazy/lib/x86_64-linux-gnu/ClangLazy.so -Xclang -add-plugin -Xclang clang-lazy -isystem$INC_PATH/QtCore -isystem$INC_PATH/QtGui -isystem$INC_PATH/QtWidgets"
No idea about isystem, maybe because you also have -I ? Anyway, re-opening because QSet doesn't have copy-ctor, so it shouldn't warn
Git commit 870a3b1256a6fefa1c1978e527528938d1edca90 by Sergio Martins. Committed on 18/11/2015 at 15:45. Pushed by smartins into branch 'master'. rule-of-three: Blacklist QSet. It's fixed in Qt 5.7 M +2 -1 checks/ruleofbase.cpp http://commits.kde.org/clazy/870a3b1256a6fefa1c1978e527528938d1edca90