From 39947109b64b93ef58eb28de9790d954790f2b18 Mon Sep 17 00:00:00 2001 From: Scott Moeller Date: Thu, 11 Mar 2021 08:40:23 -0500 Subject: [PATCH] Introduce a GCC Warning --- .github/workflows/gcc-problems.yml | 17 ++++++++++------- src/main.cpp | 2 ++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gcc-problems.yml b/.github/workflows/gcc-problems.yml index fd69dce..74e39a9 100644 --- a/.github/workflows/gcc-problems.yml +++ b/.github/workflows/gcc-problems.yml @@ -12,24 +12,27 @@ jobs: steps: - name: Check Out Repo - uses: actions/checkout@v - - - name: Install GCC - run : | - sudo apt-get install gcc + uses: actions/checkout@v2 - # For more complex builds, e.g. monorepos, build warnings may not contain the path from root. # This can interfere with annotation application. # # See the following resources for possible future fixes or alternatives. - # - https://github.com/microsoft/vscode-cpptools/issues/2266 for path fixups + # - https://github.com/actions/toolkit/issues/480 <- excellent post by xt0rted + # - https://github.com/microsoft/vscode-cpptools/issues/2266 + # - https://github.com/actions/toolkit/issues/480 # - https://github.com/actions/runner/issues/659 # - https://github.com/actions/runner/issues/765 name: Load gcc-problem-matcher - uses: ammaraskar/gcc-problem-matcher@master + uses: electronjoe/gcc-problem-matcher-ts@v1 + - + name: Problem Match Aware Change root + run: | + echo "main.cpp:44:9: warning: unused variable ‘unused_variable’ [-Wunused-variable]" - name: build run: | + echo "SHM:src/-" cd src g++ -Wall -Wextra main.cpp ./a.out diff --git a/src/main.cpp b/src/main.cpp index 95834b7..2a816c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,7 @@ #include int main() { + int unused_variable = 1; + std::cout << "Hello World" << std::endl; }