Manual: Don't wrap <programlisting> with <para>
This commit is contained in:
parent
e69c26a0ce
commit
d46deb528b
|
@ -94,7 +94,7 @@
|
||||||
analysis can be needed to avoid false warnings. Here is an example that
|
analysis can be needed to avoid false warnings. Here is an example that
|
||||||
logically is the same as the previous example:</para>
|
logically is the same as the previous example:</para>
|
||||||
|
|
||||||
<para><programlisting>void f1(char *s)
|
<programlisting>void f1(char *s)
|
||||||
{
|
{
|
||||||
s[20] = 0;
|
s[20] = 0;
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,9 @@ void f2()
|
||||||
if (x + y == 2) {
|
if (x + y == 2) {
|
||||||
f1(a);
|
f1(a);
|
||||||
}
|
}
|
||||||
}</programlisting>Cppcheck will report this message:</para>
|
}</programlisting>
|
||||||
|
|
||||||
|
<para>Cppcheck will report this message:</para>
|
||||||
|
|
||||||
<programlisting>Array 'a[10]' index 20 out of bounds</programlisting>
|
<programlisting>Array 'a[10]' index 20 out of bounds</programlisting>
|
||||||
|
|
||||||
|
@ -116,7 +118,7 @@ void f2()
|
||||||
prove that "x+y==2" can be true when the function is called from "f2". No
|
prove that "x+y==2" can be true when the function is called from "f2". No
|
||||||
error message is reported for this code:</para>
|
error message is reported for this code:</para>
|
||||||
|
|
||||||
<para><programlisting>void f1(char *s)
|
<programlisting>void f1(char *s)
|
||||||
{
|
{
|
||||||
if (x + y == 2) {
|
if (x + y == 2) {
|
||||||
s[20] = 0;
|
s[20] = 0;
|
||||||
|
@ -127,7 +129,7 @@ void f2()
|
||||||
{
|
{
|
||||||
char a[10];
|
char a[10];
|
||||||
f1(a);
|
f1(a);
|
||||||
}</programlisting></para>
|
}</programlisting>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|
|
@ -206,9 +206,9 @@ Checking path/file2.cpp...
|
||||||
|
|
||||||
<para>The output from Cppcheck is now:</para>
|
<para>The output from Cppcheck is now:</para>
|
||||||
|
|
||||||
<para><programlisting>Checking file3.c...
|
<programlisting>Checking file3.c...
|
||||||
[file3.c:3]: (style) Variable 'i' is assigned a value that is never used
|
[file3.c:3]: (style) Variable 'i' is assigned a value that is never used
|
||||||
[file3.c:3]: (style) The scope of the variable i can be reduced</programlisting></para>
|
[file3.c:3]: (style) The scope of the variable i can be reduced</programlisting>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|
Loading…
Reference in New Issue