diff --git a/Makefile b/Makefile index 7ad9d0a..98654de 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,20 @@ CC = gcc CFLAGS = -O0 -g -Wall -Wextra -std=c89 -pedantic-errors -all: test +CPPC = g++ +CPPFLAGS = -O0 -g -Wall -Wextra -.PHONY: test +all: test testcpp + +.PHONY: test testcpp test: tests.c parson.c $(CC) $(CFLAGS) -o $@ tests.c parson.c ./$@ +testcpp: tests.c parson.c + $(CPPC) $(CPPFLAGS) -o $@ tests.c parson.c + ./$@ + clean: - rm -f test *.o \ No newline at end of file + rm -f test *.o + diff --git a/parson.c b/parson.c index d2cc1af..45edaf5 100644 --- a/parson.c +++ b/parson.c @@ -404,7 +404,7 @@ static JSON_Status json_array_resize(JSON_Array *array, size_t new_capacity) { if (new_capacity == 0) { return JSONFailure; } - new_items = parson_malloc(new_capacity * sizeof(JSON_Value*)); + new_items = (JSON_Value**)parson_malloc(new_capacity * sizeof(JSON_Value*)); if (new_items == NULL) { return JSONFailure; }