Alternative to #15112 which uses clang-tidy
to do perform the checking, rather than -Wzero-as-null-pointer-constant
, and avoids having to uses pragmas, i.e:
0#if defined(HAVE_CONFIG_H)
1#include <config/bitcoin-config.h>
2#endif
3
4#if defined(HAVE_W_ZERO_AS_NULL_POINTER_CONSTANT)
5#pragma GCC diagnostic push
6#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
7#pragma GCC diagnostic ignored "-Wunknown-pragmas"
8#pragma clang diagnostic push
9#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
10#endif
to suppress warnings coming from upstream code.
Can be tested by dropping the preceding commit. Should produce errors like:
0clang-tidy-14 --use-color -p=/home/ubuntu/ci_scratch/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu /home/ubuntu/ci_scratch/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/netbase.cpp
1/home/ubuntu/ci_scratch/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/netbase.cpp:678:36: error: use nullptr [modernize-use-nullptr,-warnings-as-errors]
2 if (!Socks5(strDest, port, 0, sock)) {
3 ^
4 nullptr