diff mbox

[DOC] Add documentation for -fsanitize=enum,bool

Message ID 20141009084734.GH1002@redhat.com
State New
Headers show

Commit Message

Marek Polacek Oct. 9, 2014, 8:47 a.m. UTC
We are missing documentation for -fsanitize=bool and -fsanitize=enum,
so I've put something together.

Ok for trunk?

2014-10-09  Marek Polacek  <polacek@redhat.com>

	* doc/invoke.texi: Document -fsanitize=bool and -fsanitize=enum.


	Marek

Comments

Jakub Jelinek Oct. 9, 2014, 8:48 a.m. UTC | #1
On Thu, Oct 09, 2014 at 10:47:34AM +0200, Marek Polacek wrote:
> We are missing documentation for -fsanitize=bool and -fsanitize=enum,
> so I've put something together.
> 
> Ok for trunk?
> 
> 2014-10-09  Marek Polacek  <polacek@redhat.com>
> 
> 	* doc/invoke.texi: Document -fsanitize=bool and -fsanitize=enum.

Ok, thanks.

	Jakub
diff mbox

Patch

diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi
index 5fe7e15..8f3eb16 100644
--- gcc/doc/invoke.texi
+++ gcc/doc/invoke.texi
@@ -5604,6 +5604,19 @@  This option enables instrumentation of return statements in functions
 marked with @code{returns_nonnull} function attribute, to detect returning
 of null values from such functions.
 
+@item -fsanitize=bool
+@opindex fsanitize=bool
+
+This option enables instrumentation of loads from bool.  If a value other
+than 0/1 is loaded, a run-time error is issued.
+
+@item -fsanitize=enum
+@opindex fsanitize=enum
+
+This option enables instrumentation of loads from an enum type.  If
+a value outside the range of values for the enum type is loaded,
+a run-time error is issued.
+
 @end table
 
 While @option{-ftrapv} causes traps for signed overflows to be emitted,