From 6d089f33f7719f96614ac01f19587393a2dc8dc9 Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Sun, 13 Oct 2019 17:49:10 +0300 Subject: [PATCH] BareMetal: Parse missed SDCC compiler warning ... in a form like: at 1: warning 117: unknown compiler option '--xram-loc2' ignored Fixes: QTCREATORBUG-23083 Change-Id: If428cb7317d0c13246fcb0c1741d015a80af91b7 Reviewed-by: Christian Kandeler --- src/plugins/baremetal/sdccparser.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/plugins/baremetal/sdccparser.cpp b/src/plugins/baremetal/sdccparser.cpp index e84021dd7b0..46dfa71463a 100644 --- a/src/plugins/baremetal/sdccparser.cpp +++ b/src/plugins/baremetal/sdccparser.cpp @@ -125,7 +125,7 @@ void SdccParser::stdError(const QString &line) return; } - re.setPattern("^at (\\d+): (error) \\d+: (.+)$"); + re.setPattern("^at (\\d+): (warning|error) \\d+: (.+)$"); match = re.match(lne); if (match.hasMatch()) { enum CaptureIndex { MessageCodeIndex = 1, MessageTypeIndex, MessageTextIndex }; @@ -292,6 +292,18 @@ void BareMetalPlugin::testSdccOutputParsers_data() categoryCompile)) << QString(); + QTest::newRow("Compiler bad option warning") + << QString::fromLatin1("at 1: warning 123: Some warning") + << OutputParserTester::STDERR + << QString() + << QString::fromLatin1("at 1: warning 123: Some warning\n") + << (Tasks() << Task(Task::Warning, + QLatin1String("Some warning"), + Utils::FilePath(), + -1, + categoryCompile)) + << QString(); + QTest::newRow("Linker warning") << QString::fromLatin1("?ASlink-Warning-Couldn't find library 'foo.lib'") << OutputParserTester::STDERR