From 6b6b6449d7e8e4f78843c445a5ce63601a73da57 Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Mon, 29 Jul 2024 14:23:16 -0400 Subject: [PATCH] Remove Cppcheck from the distribution I was initially impressed with its output, but over time I've found it less and less useful. I hardly use it anymore, and it would at best be neglected if left in the distribution. The build script is retained in the contrib/ directory, and it's easy to build natively from source. --- Dockerfile | 18 ++---------------- README.md | 20 -------------------- {src => contrib}/cppcheck.mak | 0 src/SHA256SUMS | 1 - src/cppcheck-gcc13.patch | 18 ------------------ src/cppcheck-quiet.patch | 7 ------- 6 files changed, 2 insertions(+), 62 deletions(-) rename {src => contrib}/cppcheck.mak (100%) delete mode 100644 src/cppcheck-gcc13.patch delete mode 100644 src/cppcheck-quiet.patch diff --git a/Dockerfile b/Dockerfile index a7f702a..c3f39bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,6 @@ ARG MINGW_VERSION=12.0.0 ARG MPC_VERSION=1.3.1 ARG MPFR_VERSION=4.2.1 ARG PDCURSES_VERSION=3.9 -ARG CPPCHECK_VERSION=2.10 ARG VIM_VERSION=9.0 RUN apt-get update && apt-get install --yes --no-install-recommends \ @@ -37,8 +36,7 @@ RUN curl --insecure --location --remote-name-all --remote-header-name \ http://ftp.vim.org/pub/vim/unix/vim-$VIM_VERSION.tar.bz2 \ https://github.com/universal-ctags/ctags/archive/refs/tags/v$CTAGS_VERSION.tar.gz \ https://downloads.sourceforge.net/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v$MINGW_VERSION.tar.bz2 \ - https://downloads.sourceforge.net/project/pdcurses/pdcurses/$PDCURSES_VERSION/PDCurses-$PDCURSES_VERSION.tar.gz \ - https://github.com/danmar/cppcheck/archive/$CPPCHECK_VERSION.tar.gz + https://downloads.sourceforge.net/project/pdcurses/pdcurses/$PDCURSES_VERSION/PDCurses-$PDCURSES_VERSION.tar.gz COPY src/SHA256SUMS $PREFIX/src/ RUN sha256sum -c $PREFIX/src/SHA256SUMS \ && tar xJf binutils-$BINUTILS_VERSION.tar.xz \ @@ -54,8 +52,7 @@ RUN sha256sum -c $PREFIX/src/SHA256SUMS \ && tar xzf make-$MAKE_VERSION.tar.gz \ && tar xjf mingw-w64-v$MINGW_VERSION.tar.bz2 \ && tar xzf PDCurses-$PDCURSES_VERSION.tar.gz \ - && tar xjf vim-$VIM_VERSION.tar.bz2 \ - && tar xzf cppcheck-$CPPCHECK_VERSION.tar.gz + && tar xjf vim-$VIM_VERSION.tar.bz2 COPY src/w64devkit.c src/w64devkit.ico src/libmemory.c src/libchkstk.S \ src/alias.c src/debugbreak.c src/pkg-config.c src/vc++filt.c \ src/peports.c src/profile $PREFIX/src/ @@ -449,17 +446,6 @@ RUN sed -i /RT_MANIFEST/d win32/ctags.rc \ OPT= CFLAGS=-Os LDFLAGS=-s \ && cp ctags.exe $PREFIX/bin/ -WORKDIR /cppcheck-$CPPCHECK_VERSION -COPY src/cppcheck.mak src/cppcheck-*.patch $PREFIX/src/ -RUN cat $PREFIX/src/cppcheck-*.patch | patch -p1 \ - && make -f $PREFIX/src/cppcheck.mak -j$(nproc) CXX=$ARCH-g++ \ - && mkdir $PREFIX/share/cppcheck/ \ - && cp -r cppcheck.exe cfg/ $PREFIX/share/cppcheck \ - && $ARCH-gcc -DEXE=../share/cppcheck/cppcheck.exe -DCMD=cppcheck \ - -Os -fno-asynchronous-unwind-tables -Wl,--gc-sections -s -nostdlib \ - -o $PREFIX/bin/cppcheck.exe \ - $PREFIX/src/alias.c -lkernel32 - # Pack up a release WORKDIR / diff --git a/README.md b/README.md index be15f2b..1fa0035 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ Included tools: * [busybox-w32][bb] : standard unix utilities, including sh * [Vim][vim] : powerful text editor * [Universal Ctags][ctags] : source navigation -* [Cppcheck][cppcheck] : static code analysis The toolchain includes pthreads, C++11 threads, and OpenMP. All included runtime components are static. **Docker/Podman is not required to use the @@ -165,24 +164,6 @@ libraries have paths containing spaces. debugger, like using Windows' F12 debugger hotkey. Especially useful for console subsystem programs. -## Cppcheck tips - -Use `--library=windows` for programs calling the Win32 API directly, which -adds additional checks. In general, the following configuration is a good -default for programs developed using w64devkit: - - $ cppcheck --quiet -j$(nproc) --library=windows \ - --suppress=uninitvar --enable=portability,performance . - -A "strict" check that is more thorough, but more false positives: - - $ cppcheck --quiet -j$(nproc) --library=windows \ - --enable=portability,performance,style \ - --suppress=uninitvar --suppress=unusedStructMember \ - --suppress=constVariable --suppress=shadowVariable \ - --suppress=variableScope --suppress=constParameter \ - --suppress=shadowArgument --suppress=knownConditionTrueFalse . - ## Notes `$HOME` can be set through the adjacent `w64devkit.ini` configuration, and @@ -224,7 +205,6 @@ binaries. [bb]: https://frippery.org/busybox/ [break]: https://nullprogram.com/blog/2022/06/26/ [bs]: https://www.rdegges.com/2016/i-dont-give-a-shit-about-licensing/ -[cppcheck]: https://cppcheck.sourceforge.io/ [crt]: https://nullprogram.com/blog/2023/02/15/ [ctags]: https://github.com/universal-ctags/ctags [debugbreak]: https://nullprogram.com/blog/2022/07/31/ diff --git a/src/cppcheck.mak b/contrib/cppcheck.mak similarity index 100% rename from src/cppcheck.mak rename to contrib/cppcheck.mak diff --git a/src/SHA256SUMS b/src/SHA256SUMS index 3d579a3..3351a3b 100644 --- a/src/SHA256SUMS +++ b/src/SHA256SUMS @@ -1,6 +1,5 @@ f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800 binutils-2.42.tar.xz e366f887a56bf6f64adff15b7b08ba487fea14c121045078437abe7217cf060d busybox-w32-FRP-5398-g89ae34445.tgz -785dcbf711048dfe43ae920b6eff2eeebb4a096e88188a40e173ca4c030f57c3 cppcheck-2.10.tar.gz 71229a73f25529c9e3dabb2cb7310c55405d31caee8e8a9ab5c71b2406d4005a ctags-6.0.0.tar.gz ee14b4c5d8908b1bec37ad937607eab183d4d9806a08adee472c3c3121d27364 expat-2.6.2.tar.xz e283c654987afe3de9d8080bc0bd79534b5ca0d681a73a11ff2b5d3767426840 gcc-14.1.0.tar.xz diff --git a/src/cppcheck-gcc13.patch b/src/cppcheck-gcc13.patch deleted file mode 100644 index 4e4953a..0000000 --- a/src/cppcheck-gcc13.patch +++ /dev/null @@ -1,18 +0,0 @@ -GCC 13 has stricter allocator checks: -https://gcc.gnu.org/gcc-13/porting_to.html - -Also, libstdc++ no longer leaks stdint.h definitions. ---- a/lib/mathlib.cpp -+++ b/lib/mathlib.cpp -@@ -25,2 +25,3 @@ - #include -+#include - #include ---- a/lib/smallvector.h -+++ b/lib/smallvector.h -@@ -43,2 +43,5 @@ - {} -+ -+ template TaggedAllocator(const TaggedAllocator); -+ template struct rebind { using other = TaggedAllocator; }; - }; diff --git a/src/cppcheck-quiet.patch b/src/cppcheck-quiet.patch deleted file mode 100644 index b471899..0000000 --- a/src/cppcheck-quiet.patch +++ /dev/null @@ -1,7 +0,0 @@ ---- a/cli/cmdlineparser.cpp -+++ b/cli/cmdlineparser.cpp -@@ -131,3 +131,3 @@ - #if defined(_WIN64) || defined(_WIN32) --bool CmdLineParser::SHOW_DEF_PLATFORM_MSG = true; -+bool CmdLineParser::SHOW_DEF_PLATFORM_MSG = false; - #endif