Counts the C++ errors of each C source of a build, compiled the way COD2_CXX_DIRS compiles it.
python3 scripts/cxx_errors.py <build_dir> [--module PC/qcommon ...] [--max 20] [--jobs N] [--return-type]
Reads <build_dir>/compile_commands.json, and compiles each C file of the
modules (paths relative to src/) as C++ inside extern "C" { #include "x.c" },
with the C++ compiler that matches the C one and the file's own flags. Prints
"<module>: <n> errors" and the first --max errors of each module. Exits with 0
when there are none.
--return-type looks only for non-void functions that can end without a return:
C allows it when the caller ignores the value, in C++ it is undefined and GCC
drops the code after the call. It compiles without -w and with -O1, because the
check needs the flow analysis.