This is an automated email from Gerrit. "Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7679
-- gerrit commit d3fb7e10b971829131bd6c6846c7b06e10d4e027 Author: Antonio Borneo <borneo.anto...@gmail.com> Date: Sun May 7 16:15:46 2023 +0200 HACKING: add info on usage of sparse Add short example on how to run the static analyser 'sparse' on OpenOCD code. Change-Id: Ieba8ae926d0e02ca9e6ac619b13b0832136f82cb Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com> diff --git a/HACKING b/HACKING index be5699990e..fbc0eae939 100644 --- a/HACKING +++ b/HACKING @@ -77,6 +77,21 @@ patch: src/openocd -s ../tcl -f /path/to/openocd.cfg @endcode +- Sparse Static Analyzer + + Using this tool allows identifying some bug in C code. + In the future, OpenOCD would use the sparse attribute 'bitwise' to + detect incorrect endianness assignments. + + Example usage: + @code + mkdir build-sparse; cd build-sparse + ../configure CC=cgcc CFLAGS="-Wsparse-all -Wno-declaration-after-statement \ + -Wno-unknown-attribute -Wno-transparent-union -Wno-tautological-compare \ + -Wno-vla -Wno-flexible-array-array -D__FLT_EVAL_METHOD__=0" + make + @endcode + Please consider performing these additional checks where appropriate (especially Clang Static Analyzer for big portions of new code) and mention the results (e.g. "Valgrind-clean, no new Clang analyzer --