Skip to content

Commit

Permalink
Introduce a GCC Warning
Browse files Browse the repository at this point in the history
  • Loading branch information
electronjoe authored and Scott Harrison Moeller committed Mar 11, 2021
1 parent ee04933 commit 3994710
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/gcc-problems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <iostream>

int main() {
int unused_variable = 1;

std::cout << "Hello World" << std::endl;
}

0 comments on commit 3994710

Please sign in to comment.