Skip to content

Commit a898dec

Browse files
committed
fix doc build issues
Signed-off-by: Justin Stitt <[email protected]>
1 parent 4f8d5f5 commit a898dec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clang/include/clang/Basic/AttrDocs.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8076,6 +8076,7 @@ This example shows some basic usage of ``__attribute__((wraps))`` on a type
80768076
definition when building with ``-fsanitize=signed-integer-overflow``
80778077

80788078
.. code-block:: c
8079+
80798080
typedef int __attribute__((wraps)) wrapping_int;
80808081

80818082
void foo() {
@@ -8084,17 +8085,17 @@ definition when building with ``-fsanitize=signed-integer-overflow``
80848085
}
80858086

80868087
int main() { foo(); }
8087-
}
80888088

80898089
In the following example, we use ``__attribute__((wraps))`` on a variable to
80908090
disable overflow instrumentation for arithmetic expressions it appears in. We
80918091
do so with a popular overflow-checking pattern which we might not want to trip
80928092
sanitizers (like ``-fsanitize=unsigned-integer-overflow``).
80938093

80948094
.. code-block:: c
8095+
80958096
void foo(int offset) {
80968097
unsigned int A __attribute__((wraps)) = UINT_MAX;
8097-
8098+
80988099
// to check for overflow using this pattern, we may perform a real overflow
80998100
// thus triggering sanitizers to step in. Since A is "wrapping", we can be
81008101
// sure there are no sanitizer warnings.
@@ -8104,10 +8105,8 @@ sanitizers (like ``-fsanitize=unsigned-integer-overflow``).
81048105
return;
81058106
}
81068107

8107-
// now, handle non-overflow case
8108-
// ...
8108+
// now, handle non-overflow case ...
81098109
}
8110-
}
81118110

81128111
The above example demonstrates some of the power and elegance this attribute
81138112
provides. We can use code patterns we are already familiar with (like ``if (x +
@@ -8123,5 +8122,6 @@ When using this attribute without ``-fwrapv`` and without any sanitizers, it
81238122
still has an impact on the definedness of arithmetic expressions containing
81248123
wrapping components. Since the behavior of said expressions is now technically
81258124
defined, the compiler will forgo some eager optimizations that are used on
8126-
expressions containing UB.}];
8125+
expressions containing UB.
8126+
}];
81278127
}

0 commit comments

Comments
 (0)