From 6ab3a02c28f07940f0feecd853da6462838fd580 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Fri, 21 Sep 2018 12:55:07 +0200 Subject: [PATCH 1/5] Clang: Remove version check for skipping inlude file warnings The change is not upstreamed so the version number is not valid. Task-number: QTCREATORBUG-21139 Change-Id: I46fdb0a700780811b88083ae6ed55a241c705cb9 Reviewed-by: Nikolai Kosjar --- src/tools/clangbackend/source/clangbackend_global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/clangbackend/source/clangbackend_global.h b/src/tools/clangbackend/source/clangbackend_global.h index ff25ddeb818..fee9541d87e 100644 --- a/src/tools/clangbackend/source/clangbackend_global.h +++ b/src/tools/clangbackend/source/clangbackend_global.h @@ -52,7 +52,7 @@ enum class PreferredTranslationUnit #endif // CLANG-UPGRADE-CHECK: Remove IS_SKIPWARNINGSFROMINCLUDEDFILES_SUPPORTED once we require clang >= 7.0 -#if defined(CINDEX_VERSION_HAS_SKIPWARNINGSFROMINCLUDEDFILES_BACKPORTED) || CINDEX_VERSION_MINOR >= 46 +#if defined(CINDEX_VERSION_HAS_SKIPWARNINGSFROMINCLUDEDFILES_BACKPORTED) # define IS_SKIPWARNINGSFROMINCLUDEDFILES_SUPPORTED #endif From ac9ab687403a2bbd4689ac14da3fc6f6594da7a1 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 21 Sep 2018 13:52:37 +0200 Subject: [PATCH 2/5] Fix incorrect grammar in 'does not exists' Change-Id: I790d9bbdfc170808ff66e70be0f81d1c292c0bcb Reviewed-by: Eike Ziller Reviewed-by: Marco Bubke --- src/libs/clangsupport/filepathexceptions.h | 4 ++-- src/libs/sqlite/sqlstatementbuilder.cpp | 2 +- src/plugins/cppeditor/fileandtokenactions_test.cpp | 4 ++-- src/tools/clangbackend/source/clangexceptions.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/clangsupport/filepathexceptions.h b/src/libs/clangsupport/filepathexceptions.h index 32142c084c6..80bded0c662 100644 --- a/src/libs/clangsupport/filepathexceptions.h +++ b/src/libs/clangsupport/filepathexceptions.h @@ -43,7 +43,7 @@ class SourceNameIdDoesNotExists : std::exception public: const char *what() const noexcept override { - return "The source name id does not exists in the database!"; + return "The source name id does not exist in the database!"; } }; @@ -52,7 +52,7 @@ class DirectoryPathIdDoesNotExists : std::exception public: const char *what() const noexcept override { - return "The directory path id does not exists in the database!"; + return "The directory path id does not exist in the database!"; } }; diff --git a/src/libs/sqlite/sqlstatementbuilder.cpp b/src/libs/sqlite/sqlstatementbuilder.cpp index cfa08a2b7b3..3ead80b8d40 100644 --- a/src/libs/sqlite/sqlstatementbuilder.cpp +++ b/src/libs/sqlite/sqlstatementbuilder.cpp @@ -226,7 +226,7 @@ void SqlStatementBuilder::clearSqlStatement() void SqlStatementBuilder::checkIfPlaceHolderExists(Utils::SmallStringView name) const { if (name.size() < 2 || !name.startsWith('$') || !m_sqlTemplate.contains(name)) - throwException("SqlStatementBuilder::bind: placeholder name does not exists!", name.data()); + throwException("SqlStatementBuilder::bind: placeholder name does not exist!", name.data()); } void SqlStatementBuilder::checkIfNoPlaceHoldersAynmoreExists() const diff --git a/src/plugins/cppeditor/fileandtokenactions_test.cpp b/src/plugins/cppeditor/fileandtokenactions_test.cpp index 73f995c3d2b..89275d3d6ab 100644 --- a/src/plugins/cppeditor/fileandtokenactions_test.cpp +++ b/src/plugins/cppeditor/fileandtokenactions_test.cpp @@ -320,7 +320,7 @@ class FollowSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractA { public: /// Follow symbol under cursor - /// Warning: May block if file does not exists (e.g. a not generated ui_* file). + /// Warning: May block if file does not exist (e.g. a not generated ui_* file). void run(CppEditorWidget *editorWidget); }; @@ -511,7 +511,7 @@ void CppEditorPlugin::test_moveTokenWiseThroughEveryFile() TestActionsTestCase(singleAction(ActionPointer(new NoOpTokenAction))); } -/// May block if file does not exists (e.g. a not generated ui_* file). +/// May block if file does not exist (e.g. a not generated ui_* file). void CppEditorPlugin::test_moveTokenWiseThroughEveryFileAndFollowSymbol() { TestActionsTestCase(singleAction(ActionPointer(new FollowSymbolUnderCursorTokenAction))); diff --git a/src/tools/clangbackend/source/clangexceptions.cpp b/src/tools/clangbackend/source/clangexceptions.cpp index 62527b6ce77..5fff38fe81a 100644 --- a/src/tools/clangbackend/source/clangexceptions.cpp +++ b/src/tools/clangbackend/source/clangexceptions.cpp @@ -58,7 +58,7 @@ DocumentDoesNotExistException::DocumentDoesNotExistException(const Utf8String &f + filePath + Utf8StringLiteral("' with the project part id '") + projectPartId - + Utf8StringLiteral("' does not exists!"); + + Utf8StringLiteral("' does not exist!"); } DocumentFileDoesNotExistException::DocumentFileDoesNotExistException( From 813c16854df6be7fd1f1a8013d0b180f6248e5ab Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 20 Sep 2018 13:48:58 +1000 Subject: [PATCH 3/5] SshDeviceProcess: Don't emit readyRead signals if no data available Task-number: QTCREATORBUG-19367 Change-Id: I477800b2e2060748c2b5f9fde3acc91d9f5ae176 Reviewed-by: hjk Reviewed-by: Ulf Hermann --- .../projectexplorer/devicesupport/sshdeviceprocess.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp index b34e0ce8053..3bb813d55de 100644 --- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp @@ -245,13 +245,19 @@ void SshDeviceProcess::handleProcessFinished(int exitStatus) void SshDeviceProcess::handleStdout() { - d->stdOut += d->process->readAllStandardOutput(); + QByteArray output = d->process->readAllStandardOutput(); + if (output.isEmpty()) + return; + d->stdOut += output; emit readyReadStandardOutput(); } void SshDeviceProcess::handleStderr() { - d->stdErr += d->process->readAllStandardError(); + QByteArray output = d->process->readAllStandardError(); + if (output.isEmpty()) + return; + d->stdErr += output; emit readyReadStandardError(); } From ad8098b372d19c5b7d517230566fc549ff001045 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 31 Aug 2018 10:31:39 +0200 Subject: [PATCH 4/5] Fix conflicting LanguageVersion and value __cplusplus define Task-number: QTCREATORBUG-20884 Change-Id: Ieddb277ed5a7c167d75f902275b8f98cc3fc8af4 Reviewed-by: Marco Bubke Reviewed-by: Nikolai Kosjar --- src/plugins/projectexplorer/gcctoolchain.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 98b7825d5b5..f2d45e6ddea 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -383,6 +383,8 @@ static Utils::FileName findLocalCompiler(const Utils::FileName &compilerPath, return path.isEmpty() ? compilerPath : path; } +Q_GLOBAL_STATIC_WITH_ARGS(const QVector, unwantedMacros, ({"__cplusplus"})) + ToolChain::PredefinedMacrosRunner GccToolChain::createPredefinedMacrosRunner() const { // Using a clean environment breaks ccache/distcc/etc. @@ -440,17 +442,20 @@ ToolChain::PredefinedMacrosRunner GccToolChain::createPredefinedMacrosRunner() c = gccPredefinedMacros(findLocalCompiler(compilerCommand, env), arguments, env.toStringList()); - macroCache->insert(arguments, macros); + const QVector filteredMacros = Utils::filtered(macros, [](const Macro &m) { + return !unwantedMacros->contains(m.key); + }); + macroCache->insert(arguments, filteredMacros); qCDebug(gccLog) << "Reporting macros to code model:"; - for (const Macro &m : macros) { + for (const Macro &m : filteredMacros) { qCDebug(gccLog) << compilerCommand.toUserOutput() << (lang == Constants::CXX_LANGUAGE_ID ? ": C++ [" : ": C [") << arguments.join(", ") << "]" << QString::fromUtf8(m.toByteArray()); } - return macros; + return filteredMacros; }; } From 8768e39d3c8e74e583eca3897cc6de53a99c3dde Mon Sep 17 00:00:00 2001 From: Hannes Domani Date: Mon, 24 Sep 2018 17:41:27 +0200 Subject: [PATCH 5/5] Valgrind: Add target executable suffix to heob command line The suffix is needed in case the executable name contains a dot, because then the .exe suffix is not added automatically by CreateProcess(). Change-Id: Ief2cfeaa8dd8ebbfb71f69575ee9574a4f2156d3 Reviewed-by: Orgad Shaneh Reviewed-by: Eike Ziller --- src/plugins/valgrind/memchecktool.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 6078cd240cc..e67c1b37627 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -780,8 +780,9 @@ void MemcheckTool::heobAction() TaskHub::requestPopup(); return; } - if (!QFile::exists(executable) - && !QFile::exists(Utils::HostOsInfo::withExecutableSuffix(executable))) { + if (!QFile::exists(executable)) + executable = Utils::HostOsInfo::withExecutableSuffix(executable); + if (!QFile::exists(executable)) { const QString msg = tr("Heob: Cannot find %1.").arg(executable); TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID); TaskHub::requestPopup();