mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Enable use of -Wmissing-noreturn
* src/internal.h: Define a ATTRIBUTE_NO_RETURN annotation * src/lxc/lxc_container.c: Annotate lxcContainerDummyChild with ATTRIBUTE_NO_RETURN * tests/eventtest.c: Mark async thread as ATTRIBUTE_NO_RETURN * m4/virt-compile-warnings.m4: Enable -Wmissing-noreturn
This commit is contained in:
parent
7d76d5d506
commit
329e9dc629
@ -63,7 +63,6 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
|
|||||||
dontwarn="$dontwarn -Wconversion"
|
dontwarn="$dontwarn -Wconversion"
|
||||||
dontwarn="$dontwarn -Wsign-conversion"
|
dontwarn="$dontwarn -Wsign-conversion"
|
||||||
dontwarn="$dontwarn -Wold-style-definition"
|
dontwarn="$dontwarn -Wold-style-definition"
|
||||||
dontwarn="$dontwarn -Wmissing-noreturn"
|
|
||||||
dontwarn="$dontwarn -Wpacked"
|
dontwarn="$dontwarn -Wpacked"
|
||||||
dontwarn="$dontwarn -Wunused-macros"
|
dontwarn="$dontwarn -Wunused-macros"
|
||||||
dontwarn="$dontwarn -Woverlength-strings"
|
dontwarn="$dontwarn -Woverlength-strings"
|
||||||
|
@ -116,6 +116,15 @@
|
|||||||
# define ATTRIBUTE_UNUSED __attribute__((__unused__))
|
# define ATTRIBUTE_UNUSED __attribute__((__unused__))
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ATTRIBUTE_NORETURN:
|
||||||
|
*
|
||||||
|
* Macro to indicate that a function won't return to the caller
|
||||||
|
*/
|
||||||
|
# ifndef ATTRIBUTE_NORETURN
|
||||||
|
# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
|
||||||
|
# endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ATTRIBUTE_SENTINEL:
|
* ATTRIBUTE_SENTINEL:
|
||||||
*
|
*
|
||||||
|
@ -914,7 +914,8 @@ int lxcContainerStart(virDomainDefPtr def,
|
|||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lxcContainerDummyChild(void *argv ATTRIBUTE_UNUSED)
|
ATTRIBUTE_NORETURN static int
|
||||||
|
lxcContainerDummyChild(void *argv ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
_exit(0);
|
_exit(0);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ static pthread_cond_t eventThreadJobCond = PTHREAD_COND_INITIALIZER;
|
|||||||
static int eventThreadJobDone = 0;
|
static int eventThreadJobDone = 0;
|
||||||
|
|
||||||
|
|
||||||
static void *eventThreadLoop(void *data ATTRIBUTE_UNUSED) {
|
ATTRIBUTE_NORETURN static void *eventThreadLoop(void *data ATTRIBUTE_UNUSED) {
|
||||||
while (1) {
|
while (1) {
|
||||||
pthread_mutex_lock(&eventThreadMutex);
|
pthread_mutex_lock(&eventThreadMutex);
|
||||||
while (!eventThreadRunOnce) {
|
while (!eventThreadRunOnce) {
|
||||||
@ -135,7 +135,6 @@ static void *eventThreadLoop(void *data ATTRIBUTE_UNUSED) {
|
|||||||
pthread_cond_signal(&eventThreadJobCond);
|
pthread_cond_signal(&eventThreadJobCond);
|
||||||
pthread_mutex_unlock(&eventThreadMutex);
|
pthread_mutex_unlock(&eventThreadMutex);
|
||||||
}
|
}
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user