diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index ed7319052..e941de7e0 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -408,6 +408,12 @@ jobs: run: | ./cppcheck --addon=misra addons/test/misra/crash1.c | ( ! grep 'Bailing out from checking' ) + - name: Build democlient + if: matrix.os == 'ubuntu-22.04' + run: | + warnings="-pedantic -Wall -Wextra -Wcast-qual -Wno-deprecated-declarations -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-shadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar" + g++ $warnings -c -Ilib -Iexternals/tinyxml2 democlient/democlient.cpp + selfcheck: needs: build # wait for all tests to be successful first diff --git a/democlient/democlient.cpp b/democlient/democlient.cpp index 994c12a78..c904ff787 100644 --- a/democlient/democlient.cpp +++ b/democlient/democlient.cpp @@ -1,3 +1,21 @@ +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2023 Cppcheck team. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include @@ -44,7 +62,7 @@ public: cppcheck.check("test.cpp", code); } - void reportOut(const std::string &outmsg, Color c) override {} + void reportOut(const std::string & /*outmsg*/, Color /*c*/) override {} void reportErr(const ErrorMessage &msg) override { const std::string s = msg.toString(true); @@ -54,9 +72,9 @@ public: std::fprintf(logfile, "%s\n", s.c_str()); } - void reportProgress(const std::string& filename, - const char stage[], - const std::size_t value) override { + void reportProgress(const std::string& /*filename*/, + const char /*stage*/[], + const std::size_t /*value*/) override { if (std::time(nullptr) >= stoptime) { std::cout << "Time to analyse the code exceeded 2 seconds. Terminating.\n\n"; Settings::terminate();