Compare commits
No commits in common. "cppcheck/simple" and "master" have entirely different histories.
cppcheck/s
...
master
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
joj3_result.json
|
|
@ -1,5 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(MyProject)
|
||||
|
||||
add_executable(main src/simple.cpp)
|
67
conf.json
67
conf.json
|
@ -1,67 +0,0 @@
|
|||
{
|
||||
"stage": {
|
||||
"stages": [
|
||||
{
|
||||
"name": "cppcheck",
|
||||
"executor": {
|
||||
"name": "sandbox",
|
||||
"with": {
|
||||
"default": {
|
||||
"args": [
|
||||
"cppcheck",
|
||||
"--template={\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}",
|
||||
"--force",
|
||||
"--enable=all",
|
||||
"--quiet",
|
||||
"."
|
||||
],
|
||||
"env": [
|
||||
"PATH=/usr/bin:/bin:/usr/local/bin"
|
||||
],
|
||||
"cpuLimit": 10000000000,
|
||||
"memoryLimit": 419430400,
|
||||
"procLimit": 50,
|
||||
"copyInDir": ".",
|
||||
"copyOut": [
|
||||
"stdout"
|
||||
],
|
||||
"stdin": {
|
||||
"content": ""
|
||||
},
|
||||
"stdout": {
|
||||
"name": "stdout",
|
||||
"max": 65536
|
||||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 65536
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"parsers": [
|
||||
{
|
||||
"name": "cppcheck",
|
||||
"with": {
|
||||
"score": 100,
|
||||
"matches": [
|
||||
{
|
||||
"keywords": [
|
||||
"doubleFree"
|
||||
],
|
||||
"score": 5
|
||||
},
|
||||
{
|
||||
"keywords": [
|
||||
"memleak"
|
||||
],
|
||||
"score": 7
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
[{"name":"cppcheck","results":[{"score":88,"comment":"### Test results summary\n\n1. `memleak`: 1 occurrence(s), -7 point(s)\n2. `doubleFree`: 1 occurrence(s), -5 point(s)\n"}],"force_quit":false}]
|
|
@ -1,15 +0,0 @@
|
|||
// Memory leak and resource management warnings
|
||||
void memoryLeaks() {
|
||||
int *ptr = new int(42);
|
||||
// Missing delete - memory leak
|
||||
|
||||
int const *array = new int[100];
|
||||
delete ptr; // Wrong deletion type for array
|
||||
|
||||
// Double deletion
|
||||
int *doubleDel = new int(5);
|
||||
delete doubleDel;
|
||||
delete doubleDel;
|
||||
}
|
||||
|
||||
int main() { memoryLeaks(); }
|
Loading…
Reference in New Issue
Block a user