aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/ftw
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-11-22 16:58:39 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-11-26 15:57:00 +0100
commit83ed0e4cd90e384e6d735066e19c7f505189f98d (patch)
treeb91aeb6dc0e7ba44cf5581f0990f8529c7143f61 /src/qml/qml/ftw
parent024796a5be4a025c9eb1ea309f7307b1dff5c50d (diff)
qintrusivelvist_p.h: Silence nullpointer subtraction warning
Fixing this class to avoid the UB here is not worth the effort. Using a pointer which is not nullptr "works", but does not change the underlying fact that only the offsetof macro is allowed this trickery. So instead of hiding the issue, we explicitly silence it for now. Change-Id: I55f456049e78f24434e3494fc94c83681e5f46c9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/qml/ftw')
-rw-r--r--src/qml/qml/ftw/qintrusivelist_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/ftw/qintrusivelist_p.h b/src/qml/qml/ftw/qintrusivelist_p.h
index 8992be9f93..40dc45095f 100644
--- a/src/qml/qml/ftw/qintrusivelist_p.h
+++ b/src/qml/qml/ftw/qintrusivelist_p.h
@@ -241,7 +241,12 @@ typename QIntrusiveList<N, member>::iterator QIntrusiveList<N, member>::end()
template<class N, QIntrusiveListNode N::*member>
N *QIntrusiveList<N, member>::nodeToN(QIntrusiveListNode *node)
{
+ QT_WARNING_PUSH
+#if defined(Q_CC_CLANG) && Q_CC_CLANG >= 1300
+ QT_WARNING_DISABLE_CLANG("-Wnull-pointer-subtraction")
+#endif
return (N *)((char *)node - ((char *)&(((N *)nullptr)->*member) - (char *)nullptr));
+ QT_WARNING_POP
}
QIntrusiveListNode::QIntrusiveListNode()