nsxiv/.woodpecker/analysis.yml
NRK a9d2b5b088 [ci]: suppress some cppcheck warnings
cppcheck warns about passing a plain NULL to construct_argv()

	main.c:254:36: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB]
	                fidx, fcnt, w, h, z, NULL);

in our case, POSIX mandates `NULL` to be defined as `(void *)0` rather
than a plain `0` [0]. and void pointers are required to have the same
representation and size as char pointers [1]. so this is not an issue we
need to worry about.

[0]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html#tag_13_47
[1]: https://port70.net/~nsz/c/c99/n1256.html#6.2.5p27
2022-06-25 08:27:01 +02:00

29 lines
950 B
YAML

pipeline:
analysis:
image: alpine
when:
branch: master
commands: |
apk add --no-cache build-base cppcheck clang-extra-tools \
imlib2-dev xorgproto \
libxft-dev libexif-dev giflib-dev libwebp-dev >/dev/null
make config.h version.h
std="c99"
run_cppcheck() {
cppcheck --std="$std" --enable=performance,portability \
--force --quiet --inline-suppr --error-exitcode=1 \
--max-ctu-depth=8 -j"$(nproc)" \
$(make OPT_DEP_DEFAULT="$1" dump_cppflags) \
--suppress=varFuncNullUB \
*.c
}
run_tidy() {
checks="$(sed '/^#/d' .woodpecker/clang-tidy-checks | paste -d ',' -s)"
clang-tidy --warnings-as-errors="*" --checks="$checks" --quiet *.c \
-- -std="$std" $(make OPT_DEP_DEFAULT="$1" dump_cppflags)
}
run_cppcheck "0"
run_cppcheck "1"
run_tidy "0"
run_tidy "1"