From 2455ff28cd8b96d9fee329b47f8fc515e540198d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Wed, 10 May 2023 21:40:53 +0200 Subject: [PATCH] Debugger: Fix defined but not used warning Move the currentError function where it is used. Change-Id: Iba669d677b35abc0c9291572c2ccb1df3cd2ed56 Reviewed-by: Eike Ziller Reviewed-by: Qt CI Bot --- src/plugins/debugger/terminal.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/terminal.cpp b/src/plugins/debugger/terminal.cpp index 6707137e853..5de7740380f 100644 --- a/src/plugins/debugger/terminal.cpp +++ b/src/plugins/debugger/terminal.cpp @@ -38,12 +38,6 @@ using namespace Utils; namespace Debugger::Internal { -static QString currentError() -{ - int err = errno; - return QString::fromLatin1(strerror(err)); -} - Terminal::Terminal(QObject *parent) : QObject(parent) { @@ -52,6 +46,10 @@ Terminal::Terminal(QObject *parent) void Terminal::setup() { #ifdef DEBUGGER_USE_TERMINAL + const auto currentError = [] { + int err = errno; + return QString::fromLatin1(strerror(err)); + }; if (!qtcEnvironmentVariableIsSet("QTC_USE_PTY")) return;