From dff4120a378bab8269de41844f1510bbe6fd373e Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 27 Oct 2015 02:49:05 +0100 Subject: [PATCH] Add an else clause that clears the return value. This avoids several warnings with the GHS toolchain, in the form: warning #111-D: statement is unreachable This is because the sizeof() equality test is statically determined, but the following code is not discarded automatically. It is when using an explicit else clause. Change-Id: Ic0584aafc72f70badcf5285ab635f9d99eac161a Reviewed-by: Thiago Macieira --- src/corelib/tools/qstring.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index ba07259e77..5894b869da 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -958,8 +958,9 @@ inline int QString::toWCharArray(wchar_t *array) const if (sizeof(wchar_t) == sizeof(QChar)) { memcpy(array, d->data(), sizeof(QChar) * size()); return size(); + } else { + return toUcs4_helper(d->data(), size(), reinterpret_cast(array)); } - return toUcs4_helper(d->data(), size(), reinterpret_cast(array)); } QT_WARNING_POP