diff --git a/Makefile b/Makefile index d39a74220..64ef7973e 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ LIB_LDFLAGS = -shared LIB_LDLIBS = -ldl -lrt CFLAGS += -std=c11 -Iinclude -Iinclude/villas -I. -MMD -mcx16 -CFLAGS += -Wall -fdiagnostics-color=auto +CFLAGS += -Wall -Werror -fdiagnostics-color=auto CFLAGS += -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1 -DV=$(V) LDFLAGS += -pthread -L. -Wl,-rpath,'$$ORIGIN' diff --git a/include/villas/lstack.h b/include/villas/lstack.h index d5e4858b4..58250fbc0 100644 --- a/include/villas/lstack.h +++ b/include/villas/lstack.h @@ -32,7 +32,8 @@ struct lstack_head { struct lstack { struct lstack_node *node_buffer; - _Atomic struct lstack_head head, free; + _Atomic struct lstack_head head; /**> List of stack elements */ + _Atomic struct lstack_head free; /**> List of unused elements */ _Atomic size_t size, avail; }; diff --git a/lib/lstack.c b/lib/lstack.c index d930b9cd9..2988b9763 100644 --- a/lib/lstack.c +++ b/lib/lstack.c @@ -69,13 +69,9 @@ int lstack_init(struct lstack *lstack, size_t maxsz) lstack->node_buffer[i-1].next = &lstack->node_buffer[i]; lstack->node_buffer[maxsz - 1].next = NULL; - /* List of unused elements */ - lstack->free.aba = ATOMIC_VAR_INIT(0); - lstack->free.node = ATOMIC_VAR_INIT(lstack->node_buffer); - /* List of stack elements */ - lstack->head.aba = ATOMIC_VAR_INIT(0); - lstack->head.node = ATOMIC_VAR_INIT(NULL); + lstack->free = ATOMIC_VAR_INIT(((struct lstack_head) { 0, lstack->node_buffer })); + lstack->head = ATOMIC_VAR_INIT(((struct lstack_head) { 0, NULL })); lstack->size = ATOMIC_VAR_INIT(0); lstack->avail = ATOMIC_VAR_INIT(maxsz);