diff --git a/SConstruct b/SConstruct index d8548f5..ee95a13 100644 --- a/SConstruct +++ b/SConstruct @@ -41,7 +41,7 @@ test_lib_includes = ["third-party/unity/src/"] VariantDir(variant_dir, ".", duplicate=0) # Minimization flags for later: # CCFLAGS = ["-Oz", "-flto", "-ffunction-sections", "-fdata-sections", "-Wl,--gc-sections", "-lreadline"] -CCFLAGS = ["-ggdb", "-O0"] +CCFLAGS = ["-ggdb", "-O0", "-Werror", "-Wall"] env = Environment( CPPPATH=lib_includes, COMPILATIONDB_USE_ABSPATH=True, CCFLAGS=CCFLAGS ) diff --git a/run_tests.sh.in b/run_tests.sh.in index 3868185..d3fa494 100755 --- a/run_tests.sh.in +++ b/run_tests.sh.in @@ -8,4 +8,4 @@ for test in $TESTS; do if [ $? -ne 0 ] ; then exit $ret fi -done | tee | grep "Tests" +done # | tee | grep "Tests" diff --git a/src/builtins.c b/src/builtins.c index 6663002..0fa8774 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -31,6 +31,9 @@ LISP_FUNC_1(ucl_builtin_type, scope, arg) { assert(0); return NULL; } + + assert(0); + return ucl_error_create("Unreachable error in 'ucl_builtin_type'"); } LISP_FUNC_1(ucl_builtin_error, scope, arg) { @@ -147,7 +150,7 @@ LISP_FUNC_2(ucl_builtin_concat, scope, arg0, arg1) { } int len = strlen(arg0->string) + strlen(arg1->string); - char *outstr = malloc(strlen(arg0->string) + strlen(arg1->string)); + char *outstr = malloc(len); outstr[0] = '\0'; strcat(outstr, arg0->string); strcat(outstr, arg1->string); diff --git a/src/evaluate.c b/src/evaluate.c index 5c82289..d97376c 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -91,4 +91,7 @@ struct ucl_object *ucl_evaluate(struct ucl_scope *scope, struct ucl_object *obj) assert(0); return NULL; } + + assert(0); + return ucl_error_create("Unreachable error in ucl_evaluate"); } diff --git a/src/memory.c b/src/memory.c index 89ca42b..3f3ffd9 100644 --- a/src/memory.c +++ b/src/memory.c @@ -115,6 +115,7 @@ void ucl_object_delete(struct ucl_object *obj) { break; case UCL_TYPE_INT: case UCL_TYPE_BUILTIN: + case UCL_TYPE_SPECIAL: case UCL_TYPE_COUNT: break; } diff --git a/src/utility.c b/src/utility.c index 91d5a0d..4265089 100644 --- a/src/utility.c +++ b/src/utility.c @@ -144,6 +144,9 @@ void ucl_print_obj(struct ucl_object *obj) { case UCL_TYPE_BUILTIN: printf("", obj->builtin); break; + case UCL_TYPE_SPECIAL: + printf("", obj->special); + break; case UCL_TYPE_CELL: { int first = true; printf("%s", "("); @@ -212,4 +215,6 @@ struct ucl_object *ucl_equal( return ucl_error_create(""); } + assert(0); + return ucl_error_create("Unreachable error in ucl_equal"); } diff --git a/test/test_arena.c b/test/test_arena.c index a109baf..0975363 100644 --- a/test/test_arena.c +++ b/test/test_arena.c @@ -38,7 +38,6 @@ static void test_arena_get_all(void) { } static void test_arena_get_put_limit(void) { - struct test_5 *object = NULL; struct test_5 *objects[NUM_OBJECTS] = {}; for (int i = 0; i < NUM_OBJECTS; i++) { @@ -52,7 +51,6 @@ static void test_arena_get_put_limit(void) { } static void test_arena_get_over_limit(void) { - struct test_5 *object = NULL; struct test_5 *objects[NUM_OBJECTS + 1] = {}; for (int i = 0; i < NUM_OBJECTS + 1; i++) {