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:
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++}.