File: test.cxx

package info (click to toggle)
cppcheck 1.86-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 14,600 kB
  • sloc: cpp: 169,157; python: 6,329; ansic: 3,848; xml: 847; makefile: 563; sh: 429; cs: 291
file content (34 lines) | stat: -rw-r--r-- 471 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
This is testing data for the GUI.
Used for testing GUI with various error styles reported by cppcheck.
Not meant to be compiled.
*/

#include <vector>

void unused()
{
    int a = 15;
}

void f(char k)
{
    delete k;
}

void possible_style()
{
    std::list<int>::iterator it;
    for (it = ab.begin(); it != ab.end(); it++)
        ;
}

int main()
{
    char *b = new char[1];
    char *a = new char[8];
    if (a);
    b = gets();
    f(a);
    possible_style();
}