This is an automated email from Gerrit.

Paul Fertser ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/4343

-- gerrit

commit ca0ff025acb577edc9d5f5fa5f4000480d203a31
Author: Paul Fertser <[email protected]>
Date:   Tue Jan 16 15:11:18 2018 +0300

    HACKING: document practices to improve code quality
    
    Change-Id: I58a7d978b7d5bca3037c4535f06746b9f4411950
    Signed-off-by: Paul Fertser <[email protected]>

diff --git a/HACKING b/HACKING
index 162da86..cb22bc2 100644
--- a/HACKING
+++ b/HACKING
@@ -27,7 +27,42 @@ it so large that it's hard to review; split large
 patches into smaller ones. (That can also help
 track down bugs later on.) All patches should
 be "clean", which includes preserving the existing
-coding style and updating documentation as needed.
+coding style and updating documentation as needed (when adding a new
+command, the corresponding documentation should be added to
+@c doc/openocd.texi in the same commit). OpenOCD runs on both Little
+Endian and Big Endian hosts so the code can't count on specific byte
+ordering.
+
+There are several additional methods of improving the quality of your
+patch:
+
+- Runtime testing with Valgrind Memcheck
+
+  This helps to spot memory leaks, undefined behaviour due to
+  uninitialized data or wrong indexing, memory corruption, etc.
+
+- Clang Static Analyzer
+
+  Using this tool uncovers many different kinds of bugs in C code,
+  with problematic execution paths fully explained. It is a part of
+  standard Clang installation.
+
+  To generate a report, run this in the OpenOCD source directory:
+  @code
+  mkdir build-scanbuild; cd build-scanbuild
+  scan-build ../configure
+  scan-build make CFLAGS="-std=gnu99 -I. -I../../jimtcl"
+  @endcode
+
+- Runtime testing with sanitizers
+
+  Both GCC and LLVM/Clang include advanced instrumentation options to
+  detect undefined behaviour and many kinds of memory
+  errors. Available with @c -fsanitize=* command arguments.
+
+Please consider performing these additonal checks where appropriate
+(especially Clang Static Analyzer for big portions of new code) and
+mention the results in the commit message.
 
 Say in the commit message if it's a bugfix (describe the bug) or a new
 feature. Don't expect patches to merge immediately

-- 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to