Discussion:
[DOC PATCH] Add documentation for -fsanitize=enum,bool
Marek Polacek
2014-10-09 08:47:34 UTC
Permalink
We are missing documentation for -fsanitize=bool and -fsanitize=enum,
so I've put something together.

Ok for trunk?

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

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

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,

Marek
Jakub Jelinek
2014-10-09 08:48:33 UTC
Permalink
Post by Marek Polacek
We are missing documentation for -fsanitize=bool and -fsanitize=enum,
so I've put something together.
Ok for trunk?
* doc/invoke.texi: Document -fsanitize=bool and -fsanitize=enum.
Ok, thanks.

Jakub

Loading...