mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
warn about unused return values
This commit is contained in:
parent
8b2baf1311
commit
db85cc6653
3 changed files with 8 additions and 6 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<int> cbSignals = {}, std::list<int> ignoreSignals = { SIGCHLD });
|
||||
int signals_init(void (*cb)(int signal, siginfo_t *sinfo, void *ctx), std::list<int> cbSignals = {}, std::list<int> ignoreSignals = { SIGCHLD }) __attribute__ ((warn_unused_result));
|
||||
|
||||
/** Fill buffer with random data */
|
||||
ssize_t read_random(char *buf, size_t len);
|
||||
|
|
Loading…
Add table
Reference in a new issue