Manual: Minor refactorings. Added a simple build script

This commit is contained in:
Daniel Marjamäki 2009-11-15 20:04:05 +01:00
parent 469a8e4032
commit 2cbda0cfe4
2 changed files with 27 additions and 1 deletions

8
man/buildman.sh Executable file
View File

@ -0,0 +1,8 @@
#/bin/sh
xsltproc -o manual.html /usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl manual.docbook
xsltproc -o intermediate-fo-file.fo /usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl manual.docbook
fop -pdf manual.pdf -fo intermediate-fo-file.fo

View File

@ -423,6 +423,24 @@ void DestroyFred(void *p)
<para>If an exception occurs when <literal>b</literal> is allocated, <para>If an exception occurs when <literal>b</literal> is allocated,
<literal>a</literal> will leak.</para> <literal>a</literal> will leak.</para>
<para></para> <para>Here is another example:</para>
<programlisting>int *p;
int a(int sz)
{
delete [] p;
if (sz &lt;= 0)
throw std::runtime_error("size &lt;= 0");
p = new int[sz];
}</programlisting>
<para>Check that with Cppcheck:</para>
<programlisting>cppcheck --enable=exceptNew,exceptRealloc except2.cpp</programlisting>
<para>The output from Cppcheck is:</para>
<programlisting>[except2.cpp:7]: (error) Throwing exception in invalid state, p points at deallocated memory</programlisting>
</chapter> </chapter>
</book> </book>