Skip to content

Commit 398896a

Browse files
committed
[CPP-434] Change list items to ordinary paragraphs in the Recommendation section.
1 parent ce8ba86 commit 398896a

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

cpp/ql/src/Likely Bugs/Arithmetic/SignedOverflowCheck.qhelp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,35 @@ categories: (1) rewrite the signed expression so that overflow cannot occur
2222
but the signedness remains, or (2) rewrite (or cast) the signed expression
2323
into unsigned form.
2424

25-
The bullet list below lists various expressions where signed overflow may
26-
occur, along with proposed rewritings. It should not be
25+
Below we list examples of expressions where signed overflow may
26+
occur, along with proposed solutions. The list should not be
2727
considered exhaustive.
2828
</p>
2929

30-
<li>Given <code>unsigned short i, delta</code> and <code>i + delta &lt; i</code>,
30+
<p>
31+
Given <code>unsigned short i, delta</code> and <code>i + delta &lt; i</code>,
3132
it is possible to rewrite it as <code>(unsigned short)(i + delta)&nbsp;&lt;&nbsp;i</code>.
32-
Note that <code>i + delta</code>does not actually overflow, due to <code>int</code> promotion</li>
33+
Note that <code>i + delta</code>does not actually overflow, due to <code>int</code> promotion
3334

34-
<li>Given <code>unsigned short i, delta</code> and <code>i + delta &lt; i</code>,
35+
Given <code>unsigned short i, delta</code> and <code>i + delta &lt; i</code>,
3536
it is also possible to rewrite it as <code>USHORT_MAX - delta</code>. It must be true
3637
that <code>delta &gt; 0</code> and the <code>limits.h</code> or <code>climits</code>
37-
header has been included.</li>
38+
header has been included.
3839

39-
<li>Given <code>int i, delta</code> and <code>i + delta &lt; i</code>,
40+
Given <code>int i, delta</code> and <code>i + delta &lt; i</code>,
4041
it is possible to rewrite it as <code>INT_MAX - delta</code>. It must be true
4142
that <code>delta &gt; 0</code> and the <code>limits.h</code> or <code>climits</code>
42-
header has been included.</li>
43+
header has been included.
4344

44-
<li>Given <code>int i, delta</code> and <code>i + delta &lt; i</code>,
45+
Given <code>int i, delta</code> and <code>i + delta &lt; i</code>,
4546
it is also possible to rewrite it as <code>(unsigned)i + delta &lt; i</code>.
46-
Note that program semantics are affected by this change.</li>
47+
Note that program semantics are affected by this change.
4748

48-
<li>Given <code>int i, delta</code> and <code>i + delta &lt; i</code>,
49+
Given <code>int i, delta</code> and <code>i + delta &lt; i</code>,
4950
it is also possible to rewrite it as <code>unsigned int i, delta</code> and
5051
<code>i + delta &lt; i</code>. Note that program semantics are
51-
affected by this change.</li>
52-
52+
affected by this change.
53+
</p>
5354
</recommendation>
5455

5556
<example>

0 commit comments

Comments
 (0)