diff --git a/common/include/villas/list.h b/common/include/villas/list.h index f3073427c..851d31e39 100644 --- a/common/include/villas/list.h +++ b/common/include/villas/list.h @@ -41,10 +41,12 @@ /** Static list initialization */ #define LIST_INIT_STATIC(l) \ __attribute__((constructor(105))) static void UNIQUE(__ctor)() {\ - vlist_init(l); \ + int ret __attribute__((unused)); \ + ret = vlist_init(l); \ } \ __attribute__((destructor(105))) static void UNIQUE(__dtor)() { \ - vlist_destroy(l, nullptr, false); \ + int ret __attribute__((unused)); \ + ret = vlist_destroy(l, nullptr, false); \ } #define vlist_length(list) ((list)->length) @@ -70,7 +72,7 @@ struct vlist { * * @param l A pointer to the list data structure. */ -int vlist_init(struct vlist *l); +int vlist_init(struct vlist *l) __attribute__ ((warn_unused_result)); /** Destroy a list and call destructors for all list elements * @@ -78,7 +80,7 @@ int vlist_init(struct vlist *l); * @param dtor A function pointer to a desctructor which will be called for every list item when the list is destroyed. * @param l A pointer to the list data structure. */ -int vlist_destroy(struct vlist *l, dtor_cb_t dtor = nullptr, bool free = false); +int vlist_destroy(struct vlist *l, dtor_cb_t dtor = nullptr, bool free = false) __attribute__ ((warn_unused_result)); /** Append an element to the end of the list */ void vlist_push(struct vlist *l, void *p); diff --git a/common/include/villas/tsc.h b/common/include/villas/tsc.h index 889747836..33f9a4688 100644 --- a/common/include/villas/tsc.h +++ b/common/include/villas/tsc.h @@ -95,6 +95,6 @@ static uint64_t tsc_now(struct tsc *t) : rdtsc(); } -int tsc_init(struct tsc *t); +int tsc_init(struct tsc *t) __attribute__ ((warn_unused_result)); uint64_t tsc_rate_to_cycles(struct tsc *t, double rate); diff --git a/common/include/villas/utils.hpp b/common/include/villas/utils.hpp index 522e99fcd..f39b58737 100644 --- a/common/include/villas/utils.hpp +++ b/common/include/villas/utils.hpp @@ -137,7 +137,7 @@ assertExcept(bool condition, const T &exception) } /** Register a exit callback for program termination: SIGINT, SIGKILL & SIGALRM. */ -int signals_init(void (*cb)(int signal, siginfo_t *sinfo, void *ctx), std::list cbSignals = {}, std::list ignoreSignals = { SIGCHLD }); +int signals_init(void (*cb)(int signal, siginfo_t *sinfo, void *ctx), std::list cbSignals = {}, std::list ignoreSignals = { SIGCHLD }) __attribute__ ((warn_unused_result)); /** Fill buffer with random data */ ssize_t read_random(char *buf, size_t len);