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>
This commit is contained in:
parent
60f48dd09a
commit
36f8816555
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user