emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master dd91aac508: Clang debug notes


From: Paul Eggert
Subject: master dd91aac508: Clang debug notes
Date: Sun, 13 Mar 2022 15:04:31 -0400 (EDT)

branch: master
commit dd91aac508b5727e10d370f2405dbcecf9578417
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Clang debug notes
    
    * etc/DEBUG: Don’t imply Clang works as well as GCC when
    debugging Emacs.  Mention a coverage problem with Clang.
---
 etc/DEBUG | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/etc/DEBUG b/etc/DEBUG
index dd33b42f19..7d2f810d07 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -947,10 +947,10 @@ several kinds of low-level problems in C code, including:
   * Passing invalid values to some builtin functions, e.g., __builtin_clz (0).
   * Reaching __builtin_unreachable calls (in Emacs, 'eassume' failure).
 
-To use UndefinedBehaviorSanitizer with GCC and similar compilers,
-append '-fsanitize=undefined' to CFLAGS, either when running
-'configure' or running 'make'.  When supported, you can also specify
-'bound-strict' and 'float-cast-overflow'.  For example:
+To use GCC's UndefinedBehaviorSanitizer, append '-fsanitize=undefined'
+to CFLAGS, either when running 'configure' or running 'make'.
+When supported, you can also specify 'bound-strict' and
+'float-cast-overflow'.  For example:
 
   ./configure \
     CFLAGS='-O0 -g3 -fsanitize=undefined,bounds-strict,float-cast-overflow'
@@ -958,6 +958,11 @@ append '-fsanitize=undefined' to CFLAGS, either when 
running
 You may need to append '-static-libubsan' to CFLAGS if your version of
 GCC is installed in an unusual location.
 
+Clang's UB sanitizer can also be used, but has coverage problems.
+You'll need '-fsanitize=undefined -fno-sanitize=pointer-overflow' to
+suppress misguided warnings about adding zero to a null pointer,
+although this also suppresses any valid pointer overflow warnings.
+
 When using GDB to debug an executable with undefined-behavior
 sanitization, the GDB command:
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]