From 08052bf72c67b299410ca33bee2f01d4ba655290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 8 Nov 2009 18:23:54 +0100 Subject: [PATCH] webpage: created a simple website for us --- htdocs/help.html | 97 +++++++++++++++++++++++++++++++++++++++++++++++ htdocs/index.html | 9 +++++ htdocs/main.html | 22 +++++++++++ htdocs/top.html | 19 ++++++++++ 4 files changed, 147 insertions(+) create mode 100644 htdocs/help.html create mode 100644 htdocs/index.html create mode 100644 htdocs/main.html create mode 100644 htdocs/top.html diff --git a/htdocs/help.html b/htdocs/help.html new file mode 100644 index 000000000..f4bf017eb --- /dev/null +++ b/htdocs/help.html @@ -0,0 +1,97 @@ + + + +

Help

+ +

If you have a question, you can ask in our forum.

+ + +

First example

+ +Here is a simple code: +
int main()
+{
+    char a[10];
+    a[10] = 0;
+    return 0;
+}
+ +If you save that into file1.c and execute: + +
cppcheck file1.c
+The output from cppcheck will then be: +
Checking file1.c...
+[file1.c:4]: (error) Array index out of bounds
+ +

Checking all files in a folder

+ +Normally a program has many sourcefiles. And you want to check them all. Cppcheck can check all sourcefiles in a directory: +
cppcheck path
+ +If "path" is a folder all sourcefiles in it will be checked: + +
Checking path/file1.cpp...
+1/2 files checked 50% done
+Checking path/file2.cpp...
+2/2 files checked 100% done
+ + +

Uncertain errors

+ +

By default, only certain errors are reported.

+ +

With "--all" you will get more reports. But beware - some messages may be wrong.

+ +

Here is a simple code example:

+ +
void f()
+{
+    Fred *fred = new Fred;
+}
+ +

Execute this command:

+ +
cppcheck --all file1.cpp
+ +

The output from Cppcheck:

+ +
[file1.cpp:4]: (possible error) Memory leak: fred
+ +

The "possible" means that the reported message may be wrong (if Fred has automatic deallocation it is not a memory leak).

+ + +

Stylistic issues

+ +

By default Cppcheck will only check for bugs. There are also a few checks for stylistic issues.

+ +

Here is a simple code example:

+ +
void f(int x)
+{
+    int i;
+    if (x == 0)
+    {
+        i = 0;
+    }
+}
+ +

To enable stylistic checks, use the --style flag:

+ +
cppcheck --style file3.c
+ +
[file3.c:3]: (style) The scope of the variable i can be limited
+ + +

More..

+ +

You can generate XML output:

+
cppcheck --xml file3.c
+ +

You can suppress certain errors:

+
cppcheck --suppressions=mysuppressions.txt file3.c
+ +

If you get false positives about memory leaks because of automatic deallocation:

+
cppcheck --auto-dealloc autodealloc.lst file4.cpp
+ + + diff --git a/htdocs/index.html b/htdocs/index.html new file mode 100644 index 000000000..15580fd0b --- /dev/null +++ b/htdocs/index.html @@ -0,0 +1,9 @@ + + +Cppcheck + + + + + + diff --git a/htdocs/main.html b/htdocs/main.html new file mode 100644 index 000000000..21c1d07ee --- /dev/null +++ b/htdocs/main.html @@ -0,0 +1,22 @@ + + + +

Cppcheck

+ +

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.

+ +

We recommend that you enable as many warnings as possible in your compiler. If you use GCC: take a look at Warning options - using GCC.

+ +

Supported platforms

+Cppcheck is versatile: + + +

Reviews

+

You can see all reviews on this page

+ + + diff --git a/htdocs/top.html b/htdocs/top.html new file mode 100644 index 000000000..6f5fb882a --- /dev/null +++ b/htdocs/top.html @@ -0,0 +1,19 @@ + + + + + + + + + +[Mainpage]    +[Help]    +[Developer info]    +[Download]    + + + + + +