diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2023-05-07 16:15:46 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2023-05-18 10:17:30 +0000 |
commit | f20173a01f3eec286b2e2daac12834229cbfa3c8 (patch) | |
tree | b6c9dae92b88a0146d23faf91abb9cebe91b3a47 /HACKING | |
parent | 17f86fdedf03626eed545dcd69c6387a825e0b5d (diff) | |
download | riscv-openocd-f20173a01f3eec286b2e2daac12834229cbfa3c8.zip riscv-openocd-f20173a01f3eec286b2e2daac12834229cbfa3c8.tar.gz riscv-openocd-f20173a01f3eec286b2e2daac12834229cbfa3c8.tar.bz2 |
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.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7679
Tested-by: jenkins
Diffstat (limited to 'HACKING')
-rw-r--r-- | HACKING | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 |