Add -Wall,-Werror compiler flags
This commit is contained in:
@@ -41,7 +41,7 @@ test_lib_includes = ["third-party/unity/src/"]
|
|||||||
VariantDir(variant_dir, ".", duplicate=0)
|
VariantDir(variant_dir, ".", duplicate=0)
|
||||||
# Minimization flags for later:
|
# Minimization flags for later:
|
||||||
# CCFLAGS = ["-Oz", "-flto", "-ffunction-sections", "-fdata-sections", "-Wl,--gc-sections", "-lreadline"]
|
# CCFLAGS = ["-Oz", "-flto", "-ffunction-sections", "-fdata-sections", "-Wl,--gc-sections", "-lreadline"]
|
||||||
CCFLAGS = ["-ggdb", "-O0"]
|
CCFLAGS = ["-ggdb", "-O0", "-Werror", "-Wall"]
|
||||||
env = Environment(
|
env = Environment(
|
||||||
CPPPATH=lib_includes, COMPILATIONDB_USE_ABSPATH=True, CCFLAGS=CCFLAGS
|
CPPPATH=lib_includes, COMPILATIONDB_USE_ABSPATH=True, CCFLAGS=CCFLAGS
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ for test in $TESTS; do
|
|||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
exit $ret
|
exit $ret
|
||||||
fi
|
fi
|
||||||
done | tee | grep "Tests"
|
done # | tee | grep "Tests"
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ LISP_FUNC_1(ucl_builtin_type, scope, arg) {
|
|||||||
assert(0);
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(0);
|
||||||
|
return ucl_error_create("Unreachable error in 'ucl_builtin_type'");
|
||||||
}
|
}
|
||||||
|
|
||||||
LISP_FUNC_1(ucl_builtin_error, scope, arg) {
|
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);
|
int len = strlen(arg0->string) + strlen(arg1->string);
|
||||||
char *outstr = malloc(strlen(arg0->string) + strlen(arg1->string));
|
char *outstr = malloc(len);
|
||||||
outstr[0] = '\0';
|
outstr[0] = '\0';
|
||||||
strcat(outstr, arg0->string);
|
strcat(outstr, arg0->string);
|
||||||
strcat(outstr, arg1->string);
|
strcat(outstr, arg1->string);
|
||||||
|
|||||||
@@ -91,4 +91,7 @@ struct ucl_object *ucl_evaluate(struct ucl_scope *scope, struct ucl_object *obj)
|
|||||||
assert(0);
|
assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(0);
|
||||||
|
return ucl_error_create("Unreachable error in ucl_evaluate");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ void ucl_object_delete(struct ucl_object *obj) {
|
|||||||
break;
|
break;
|
||||||
case UCL_TYPE_INT:
|
case UCL_TYPE_INT:
|
||||||
case UCL_TYPE_BUILTIN:
|
case UCL_TYPE_BUILTIN:
|
||||||
|
case UCL_TYPE_SPECIAL:
|
||||||
case UCL_TYPE_COUNT:
|
case UCL_TYPE_COUNT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,9 @@ void ucl_print_obj(struct ucl_object *obj) {
|
|||||||
case UCL_TYPE_BUILTIN:
|
case UCL_TYPE_BUILTIN:
|
||||||
printf("<builtin %p>", obj->builtin);
|
printf("<builtin %p>", obj->builtin);
|
||||||
break;
|
break;
|
||||||
|
case UCL_TYPE_SPECIAL:
|
||||||
|
printf("<special %p>", obj->special);
|
||||||
|
break;
|
||||||
case UCL_TYPE_CELL: {
|
case UCL_TYPE_CELL: {
|
||||||
int first = true;
|
int first = true;
|
||||||
printf("%s", "(");
|
printf("%s", "(");
|
||||||
@@ -212,4 +215,6 @@ struct ucl_object *ucl_equal(
|
|||||||
return ucl_error_create("");
|
return ucl_error_create("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(0);
|
||||||
|
return ucl_error_create("Unreachable error in ucl_equal");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ static void test_arena_get_all(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void test_arena_get_put_limit(void) {
|
static void test_arena_get_put_limit(void) {
|
||||||
struct test_5 *object = NULL;
|
|
||||||
struct test_5 *objects[NUM_OBJECTS] = {};
|
struct test_5 *objects[NUM_OBJECTS] = {};
|
||||||
|
|
||||||
for (int i = 0; i < NUM_OBJECTS; i++) {
|
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) {
|
static void test_arena_get_over_limit(void) {
|
||||||
struct test_5 *object = NULL;
|
|
||||||
struct test_5 *objects[NUM_OBJECTS + 1] = {};
|
struct test_5 *objects[NUM_OBJECTS + 1] = {};
|
||||||
|
|
||||||
for (int i = 0; i < NUM_OBJECTS + 1; i++) {
|
for (int i = 0; i < NUM_OBJECTS + 1; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user