Chapter 2. Getting started

Table of Contents

First test
Checking all files in a folder
Excluding a file or folder from checking
Stylistic issues
Saving results in file
Unused functions
Enable all checks
Multithreaded checking

First test

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 'a[10]' index 10 out of bounds