This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ubsan] Improve documentation of -fsanitize=undefined


This patch hopefully improves the documentation of the option in
question.

Applying to ubsan branch.

diff --git a/gcc/ChangeLog.ubsan b/gcc/ChangeLog.ubsan
index ac584ff..d7932c5 100644
--- a/gcc/ChangeLog.ubsan
+++ b/gcc/ChangeLog.ubsan
@@ -1,3 +1,7 @@
+2013-07-31  Marek Polacek  <polacek@redhat.com>
+
+       * doc/invoke.texi: Improve documentation of -fsanitize=undefined.
+
 2013-07-30  Marek Polacek  <polacek@redhat.com>
 
        * config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Use flag_sanitize
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5dd9a62..652220b 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -5150,8 +5150,11 @@ See @uref{http://code.google.com/p/data-race-test/wiki/ThreadSanitizer} for 
 
 @item -fsanitize=undefined
 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector
-Various computations will be instrumented to detect
-undefined behavior, e.g.@: division by zero or various overflows.
+Various computations will be instrumented to detect undefined behavior
+at runtime, e.g.@: division by zero or various overflows.
+While @option{-ftrapv} causes traps for signed overflows to be emitted,
+@option{-fsanitize=undefined} gives a diagnostic message.
+This currently works only for the C family of languages.
 
 @item -fdump-final-insns@r{[}=@var{file}@r{]}
 @opindex fdump-final-insns

	Marek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]