Skip to content

Commit

Permalink
Remove Cppcheck from the distribution
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
skeeto committed Jul 29, 2024
1 parent ec561da commit 6b6b644
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 62 deletions.
18 changes: 2 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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/
Expand Down Expand Up @@ -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 /
Expand Down
20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion src/SHA256SUMS
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 0 additions & 18 deletions src/cppcheck-gcc13.patch

This file was deleted.

7 changes: 0 additions & 7 deletions src/cppcheck-quiet.patch

This file was deleted.

0 comments on commit 6b6b644

Please sign in to comment.