]> Savannah Git Hosting - gnulib.git/commitdiff
doc: mention static and dynamic checking
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Dec 2020 01:31:43 +0000 (17:31 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Dec 2020 01:35:35 +0000 (17:35 -0800)
* doc/gnulib-readme.texi (High Quality): Add a bit of advice
for static and dynamic checking.

ChangeLog
doc/gnulib-readme.texi

index 72895ac78d16bda763968f5dfaacc6ce13a78ed7..d07d9687885753fdc52df412db847d1f39730c23 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2020-12-05  Paul Eggert  <eggert@cs.ucla.edu>
 
+       doc: mention static and dynamic checking
+       * doc/gnulib-readme.texi (High Quality): Add a bit of advice
+       for static and dynamic checking.
+
        intprops: Add INT_ADD_OK etc.
        * doc/intprops.texi (Checking Integer Overflow): New section.
        * lib/intprops.h: From a suggestion by Bruno Haible in:
index 4775fa89a3d4984a8dd2d9b00164802178aee664..a2a59628b17801ed0c478c89734f367b567441c9 100644 (file)
@@ -529,3 +529,25 @@ break.  This means that before any change can be committed to the
 repository, a test suite program must be produced that exposes the bug
 for regression testing.  All experimental work should be done on
 branches to help promote this.
+
+When compiling and testing Gnulib and Gnulib-using programs, certain
+compiler options can help improve reliability.  The
+@code{manywarnings} module enables several forms of static checking in
+GCC and related compilers (@pxref{manywarnings}).  For dynamic checking,
+you can run @code{configure} with @code{CFLAGS} options appropriate
+for your compiler.  For example:
+
+@example
+./configure \
+ CFLAGS='-g3 -O2'\
+' -D_FORTIFY_SOURCE=2'\
+' -fsanitize=undefined'\
+' -fsanitize-undefined-trap-on-error'
+@end example
+
+@noindent
+Here, @code{-D_FORTIFY_SOURCE=2} enables extra security hardening
+checks in the GNU C library, @code{-fsanitize=undefined} enables GCC's
+undefined behavior sanitizer (@code{ubsan}), and
+@code{-fsanitize-undefined-trap-on-error} prevents @code{ubsan}'s
+linking to unnecessary libraries like @code{libstdc++}.