webpage: created a simple website for us
This commit is contained in:
parent
41e59d8348
commit
08052bf72c
|
@ -0,0 +1,97 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Help</h1>
|
||||||
|
|
||||||
|
<p>If you have a question, you can ask in our <a href="http://sourceforge.net/apps/phpbb/cppcheck/">forum</a>.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>First example</h2>
|
||||||
|
|
||||||
|
Here is a simple code:
|
||||||
|
<blockquote><code><pre>int main()
|
||||||
|
{
|
||||||
|
char a[10];
|
||||||
|
a[10] = 0;
|
||||||
|
return 0;
|
||||||
|
}</pre></code></blockquote>
|
||||||
|
|
||||||
|
If you save that into <i>file1.c</i> and execute:
|
||||||
|
|
||||||
|
<blockquote><code><pre>cppcheck file1.c</pre></code></blockquote>
|
||||||
|
The output from cppcheck will then be:
|
||||||
|
<blockquote><code><pre>Checking file1.c...
|
||||||
|
[file1.c:4]: (error) Array index out of bounds</pre></code></blockquote>
|
||||||
|
|
||||||
|
<h2>Checking all files in a folder</h2>
|
||||||
|
|
||||||
|
Normally a program has many sourcefiles. And you want to check them all. Cppcheck can check all sourcefiles in a directory:
|
||||||
|
<blockquote><code><pre>cppcheck path</pre></code></blockquote>
|
||||||
|
|
||||||
|
If "path" is a folder all sourcefiles in it will be checked:
|
||||||
|
|
||||||
|
<blockquote><code><pre>Checking path/file1.cpp...
|
||||||
|
1/2 files checked 50% done
|
||||||
|
Checking path/file2.cpp...
|
||||||
|
2/2 files checked 100% done</pre></code></blockquote>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Uncertain errors</h2>
|
||||||
|
|
||||||
|
<p>By default, only certain errors are reported.</p>
|
||||||
|
|
||||||
|
<p>With "--all" you will get more reports. But beware - some messages may be wrong.</p>
|
||||||
|
|
||||||
|
<p>Here is a simple code example:</p>
|
||||||
|
|
||||||
|
<blockquote><code><pre>void f()
|
||||||
|
{
|
||||||
|
Fred *fred = new Fred;
|
||||||
|
}</pre></code></blockquote>
|
||||||
|
|
||||||
|
<p>Execute this command:</p>
|
||||||
|
|
||||||
|
<blockquote><code><pre>cppcheck --all file1.cpp</pre></code></blockquote>
|
||||||
|
|
||||||
|
<p>The output from Cppcheck:</p>
|
||||||
|
|
||||||
|
<blockquote><code><pre>[file1.cpp:4]: (possible error) Memory leak: fred</pre></code></blockquote>
|
||||||
|
|
||||||
|
<p>The "possible" means that the reported message may be wrong (if Fred has automatic deallocation it is not a memory leak).</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Stylistic issues</h2>
|
||||||
|
|
||||||
|
<p>By default Cppcheck will only check for bugs. There are also a few checks for stylistic issues.</p>
|
||||||
|
|
||||||
|
<p>Here is a simple code example:</p>
|
||||||
|
|
||||||
|
<blockquote><code><pre>void f(int x)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
if (x == 0)
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}</pre></code></blockquote>
|
||||||
|
|
||||||
|
<p>To enable stylistic checks, use the --style flag:</p>
|
||||||
|
|
||||||
|
<blockquote><code><pre>cppcheck --style file3.c</pre></code></blockquote>
|
||||||
|
|
||||||
|
<blockquote><code><pre>[file3.c:3]: (style) The scope of the variable i can be limited</pre></code></blockquote>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>More..</h2>
|
||||||
|
|
||||||
|
<p>You can generate XML output:</p>
|
||||||
|
<blockquote><code><pre>cppcheck --xml file3.c</pre></code></blockquote>
|
||||||
|
|
||||||
|
<p>You can suppress certain errors:</p>
|
||||||
|
<blockquote><code><pre>cppcheck --suppressions=mysuppressions.txt file3.c</pre></code></blockquote>
|
||||||
|
|
||||||
|
<p>If you get false positives about memory leaks because of automatic deallocation:</p>
|
||||||
|
<blockquote><code><pre>cppcheck --auto-dealloc autodealloc.lst file4.cpp</pre></code></blockquote>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Cppcheck</title>
|
||||||
|
</head>
|
||||||
|
<frameset rows="30,*">
|
||||||
|
<frame src="top.html" name="navbar" frameborder="0">
|
||||||
|
<frame src="main.html" name="page" frameborder="0">
|
||||||
|
</frameset>
|
||||||
|
</html>
|
|
@ -0,0 +1,22 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Cppcheck</h1>
|
||||||
|
|
||||||
|
<p>Cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers and many other analysis tools, we don't detect syntax errors. Cppcheck only detects the types of bugs that the compilers normally fail to detect. The goal is no false positives.</p>
|
||||||
|
|
||||||
|
<p>We recommend that you enable as many warnings as possible in your compiler. If you use GCC: take a look at <a href="http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html">Warning options - using GCC</a>.</p>
|
||||||
|
|
||||||
|
<h2>Supported platforms</h2>
|
||||||
|
Cppcheck is versatile:
|
||||||
|
<ul>
|
||||||
|
<li>You can check non-standard code that includes various compiler extensions, inline assembly code, etc.</li>
|
||||||
|
<li>Cppcheck is supposed to be compilable by any C++ compiler which handles the latest C++ standard.</li>
|
||||||
|
<li>Cppcheck is supposed to work on any platform that has sufficient cpu and memory.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Reviews</h2>
|
||||||
|
<p>You can see all reviews on <a href="http://sourceforge.net/projects/cppcheck/reviews">this page</a></p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,19 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<base target="page">
|
||||||
|
</head>
|
||||||
|
<body bgcolor="black" vlink="white" alink="white" link="white">
|
||||||
|
|
||||||
|
<font face="courier new" color="white" size="-1">
|
||||||
|
|
||||||
|
<b>
|
||||||
|
[<a href="main.html">Mainpage</a>]
|
||||||
|
[<a href="help.html">Help</a>]
|
||||||
|
[<a href="devinfo.html">Developer info</a>]
|
||||||
|
[<a href="http://sourceforge.net/projects/cppcheck/files">Download</a>]
|
||||||
|
</b>
|
||||||
|
|
||||||
|
</font>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue