summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qoffsetstringarray_p.h
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2020-10-07 19:42:31 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2020-10-09 06:15:15 +0000
commitcb1004f94a175b3ffc93ca9627074e2aaff31f1a (patch)
treef0a479fe401a144d20a0a80edb20146d953b29ce /src/corelib/tools/qoffsetstringarray_p.h
parent22b72a6f7a8f6b056f1ab9c3c7806ae87bfefd8a (diff)
Disable spurious warning with gcc 9.3
gcc 9.3 gives a warning when compiling with -O2: ‘strlen’ argument missing terminating nul [-Werror=stringop-overflow=] This seems to be caused by a gcc bug that is not present in gcc 8 and fixed in gcc 10: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91490 Change-Id: Ice3c18efb7a41097521ecee22d060f175083c579 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/corelib/tools/qoffsetstringarray_p.h')
-rw-r--r--src/corelib/tools/qoffsetstringarray_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/tools/qoffsetstringarray_p.h b/src/corelib/tools/qoffsetstringarray_p.h
index 72df8f1737..f99e6b800b 100644
--- a/src/corelib/tools/qoffsetstringarray_p.h
+++ b/src/corelib/tools/qoffsetstringarray_p.h
@@ -135,6 +135,10 @@ constexpr StaticString<Sum> staticString(const char (&s)[I], const char (&...sx)
QT_WARNING_POP
} // namespace QtPrivate
+QT_WARNING_PUSH
+#if defined(Q_CC_GNU) && __GNUC__ == 9
+QT_WARNING_DISABLE_GCC("-Wstringop-overflow")
+#endif
template<typename T, int SizeString, int SizeOffsets>
class QOffsetStringArray
{
@@ -169,6 +173,7 @@ private:
QtPrivate::StaticString<SizeString> m_string;
const T m_offsets[SizeOffsets];
};
+QT_WARNING_POP
template<typename T, int N, int ... Ox>
constexpr QOffsetStringArray<T, N, sizeof ... (Ox)> qOffsetStringArray(