feat: adjust array-dim2 according to Memcheck result
This commit is contained in:
parent
1ea03141b4
commit
649e1ecbee
|
@ -0,0 +1 @@
|
|||
*.o
|
|
@ -26,10 +26,11 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
json_decref(arrayInt);
|
||||
|
||||
|
||||
sizeArAr = json_array_size(arrayArray);
|
||||
fprintf(stdout,"main() size(arrayArray): %ld\n", sizeArAr);
|
||||
|
||||
json_decref(arrayArray);
|
||||
|
||||
fprintf(stdout,"main() Done.\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,12 @@ CC = /usr/bin/gcc
|
|||
all: main.o
|
||||
$(CC) main.c -L/usr/lib/x86_64-linux-gnu -ljansson -Wall -o $(EXE)
|
||||
#
|
||||
#Compile your program with -g to include debugging information so that Memcheck's error messages include exact line numbers.
|
||||
#-O0 means no optmization
|
||||
#-g - adds debugging symbols to executable
|
||||
debug: main.o
|
||||
$(CC) main.c -L/usr/lib/x86_64-linux-gnu -ljansson -Wall -o $(EXE) -O0 -g
|
||||
#
|
||||
main.o:
|
||||
$(CC) -c main.c
|
||||
# Clean Up Objects, Exectuables, Dumps out of source directory
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
make clean all
|
||||
```
|
||||
|
||||
* build in debugging mode
|
||||
|
||||
```
|
||||
make debug
|
||||
```
|
||||
|
||||
* cleanup
|
||||
|
||||
```
|
||||
|
@ -15,3 +21,9 @@ make clean
|
|||
```
|
||||
./main
|
||||
```
|
||||
|
||||
* run Valgrind tool `Memcheck`
|
||||
|
||||
```
|
||||
valgrind --leak-check=yes -s ./main
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue