Add -Wextra compiler flag
This commit is contained in:
@@ -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", "-Werror", "-Wall"]
|
||||
CCFLAGS = ["-ggdb", "-O0", "-Werror", "-Wall", "-Wextra", "-Wno-unused-parameter"]
|
||||
env = Environment(
|
||||
CPPPATH=lib_includes, COMPILATIONDB_USE_ABSPATH=True, CCFLAGS=CCFLAGS
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@ struct ucl_arena *ucl_arena_create(size_t object_size, size_t capacity) {
|
||||
void ucl_arena_map(struct ucl_arena *arena, void (*map_function)(struct ucl_arena * arena, void *object)) {
|
||||
size_t used_map_ints = DIV_ROUND_UP(arena->capacity, INT_BITS);
|
||||
|
||||
for (int i = 0; i < used_map_ints; i++ ) {
|
||||
for (unsigned int i = 0; i < used_map_ints; i++ ) {
|
||||
// TODO: Allow for 'put' in map
|
||||
int map = arena->used_map[i];
|
||||
while (map) {
|
||||
@@ -60,8 +60,8 @@ void *ucl_arena_get(struct ucl_arena *arena) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int bit_index = __builtin_ffs(~map) - 1;
|
||||
int index = bit_index + INT_BITS * i;
|
||||
unsigned int bit_index = __builtin_ffs(~map) - 1;
|
||||
unsigned int index = bit_index + INT_BITS * i;
|
||||
if (index >= arena->capacity) {
|
||||
// This might happen in the last used_map_int when (capacity % int_bits != 0)
|
||||
return NULL;
|
||||
@@ -88,7 +88,6 @@ void ucl_arena_put(struct ucl_arena *arena, void *object) {
|
||||
unsigned int bit_index = index % INT_BITS;
|
||||
|
||||
assert(offset % arena->object_size == 0);
|
||||
assert(index >= 0);
|
||||
assert(index < arena->capacity);
|
||||
|
||||
assert(arena->used_map[int_index] & (1 << bit_index));
|
||||
|
||||
@@ -127,7 +127,7 @@ struct ucl_object *ucl_parse_token_atom(struct ucl_object *maybe_atom) {
|
||||
break;
|
||||
case UCL_TYPE_SYMBOL: {
|
||||
// Check for reserved tokens first, which indicate special, non-atom behavior
|
||||
for (int i = 0; i < ARRAY_SIZE(reserved_symbols); i++) {
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(reserved_symbols); i++) {
|
||||
if (!strcmp(maybe_atom->string, reserved_symbols[i])) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user