summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qstring
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-01-27 15:21:57 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2017-01-31 09:27:56 +0000
commit36f8816555da28b01d38032b4d298300681c61a5 (patch)
treebe22b2d9ec1a2e311959ebc662c2f4fb03876aa8 /tests/auto/corelib/tools/qstring
parent60f48dd09aad4266fa4aaaa7b6228b9a8394cc73 (diff)
Fix 2 clang warnings
The first one was already suppressed for GCC, so also do that for clang: /Users/erik/dev/qt5-dev/qtbase/tests/auto/corelib/tools/qstring/tst_qstring.cpp:1076:16: warning: format string is not a string literal (potentially insecure) [-Wformat-security] a.sprintf( zero ); ^~~~ /Users/erik/dev/qt5-dev/qtbase/tests/auto/corelib/tools/qstring/tst_qstring.cpp:1076:16: note: treat the string as an argument to avoid this a.sprintf( zero ); ^ "%s", The second one could also occur with other compilers, so fix it in a generic way. /Users/erik/dev/qt5-dev/qtbase/tests/auto/corelib/tools/qstring/tst_qstring.cpp:6382:5: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result] string.repeated(3); ^~~~~~~~~~~~~~~ ~ 2 warnings generated. Change-Id: Id999179e795580a37b5be673ee54d6fa1a006dd7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools/qstring')
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 6ed7b74277..727eda7456 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -1066,6 +1066,7 @@ void tst_QString::acc_01()
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wformat-security")
+QT_WARNING_DISABLE_CLANG("-Wformat-security")
void tst_QString::isNull()
{
@@ -6345,7 +6346,7 @@ void tst_QString::repeatedSignature() const
{
/* repated() should be a const member. */
const QString string;
- string.repeated(3);
+ (void) string.repeated(3);
}
void tst_QString::repeated() const