From ca50d9d16bade5a6833f2a056f9a89dab3ac5433 Mon Sep 17 00:00:00 2001 From: Maksim Danilov Date: Sun, 7 Apr 2024 12:24:30 +0200 Subject: [PATCH] Fix all warnings --- .github/workflows/main.yml | 18 +++++++++--------- .vscode/settings.json | 7 ++++++- CMakeLists.txt | 3 ++- .../first_common_ancestor.cpp | 2 ++ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d255580..4b19166 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,13 +7,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - submodules: true + - uses: actions/checkout@v2 + with: + submodules: true - - name: configure - run: mkdir build && cd build && cmake .. - - name: build - run: cmake --build build - - name: test - run: cd build && ctest + - name: configure + run: mkdir build && cd build && cmake .. + - name: build + run: cmake --build build + - name: test + run: cd build && ctest diff --git a/.vscode/settings.json b/.vscode/settings.json index 019a014..615686d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -68,7 +68,12 @@ "locale": "cpp", "mutex": "cpp", "ratio": "cpp", - "variant": "cpp" + "variant": "cpp", + "any": "cpp", + "charconv": "cpp", + "condition_variable": "cpp", + "csignal": "cpp", + "span": "cpp" }, "editor.tabSize": 2 } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index bb870d5..b8d498e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.13) project(CrackingCoding) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_COMPILE_WARNING_AS_ERROR ON) enable_testing() diff --git a/src/04_trees_and_graphs/first_common_ancestor.cpp b/src/04_trees_and_graphs/first_common_ancestor.cpp index 08af3dc..afcebe5 100644 --- a/src/04_trees_and_graphs/first_common_ancestor.cpp +++ b/src/04_trees_and_graphs/first_common_ancestor.cpp @@ -3,6 +3,8 @@ // in a data structure. NOTE: This is not necessarily a binary search tree. // Hints: # 10, #16, #28, #36, #46, #70, #80, #96 +#include + #include "utils/tree.h" using namespace utils;