From 470f92167f64b4cc39fa43952829ed10d028986b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 21 Mar 2013 14:26:48 -0700 Subject: [PATCH] Silence warning by Apple Clang 4.2 about adding an integer to a string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It gives a good suggestion on what to do and even shows us how to do it. doc.cpp:2681:34: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int] result += " " + (column % tabSize); ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ doc.cpp:2681:34: note: use array indexing to silence this warning result += " " + (column % tabSize); ^ & [ ] Change-Id: Idd2157ab04cd2a3e37a1336bb5e8926ddc14823a Reviewed-by: Tor Arne Vestbø --- src/tools/qdoc/doc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index e20e85028f..12056502d5 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -2678,7 +2678,7 @@ QString DocParser::untabifyEtc(const QString& str) if (c == QLatin1Char('\r')) continue; if (c == QLatin1Char('\t')) { - result += " " + (column % tabSize); + result += &" "[column % tabSize]; column = ((column / tabSize) + 1) * tabSize; continue; }