Commit f7db1e80 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Introduce VLC_NORETURN function attribute and use it

Note that this attribute implies that the function never returns in
any circumstances (it exits, it aborts or it gets cancelled).
Do not use this attribute for function that do not return at the end
but may return from other branches.
parent 9fd4a6a6
......@@ -92,6 +92,7 @@
# define VLC_FORMAT_ARG(x) __attribute__ ((format_arg(x)))
# define VLC_MALLOC __attribute__ ((malloc))
# define VLC_NORETURN __attribute__ ((noreturn))
# if VLC_GCC_VERSION(3,4)
# define VLC_USED __attribute__ ((warn_unused_result))
......@@ -104,6 +105,7 @@
# define VLC_FORMAT(x,y)
# define VLC_FORMAT_ARG(x)
# define VLC_MALLOC
# define VLC_NORETURN
# define VLC_USED
#endif
......
......@@ -1554,6 +1554,7 @@ static int mms_HeaderMediaRead( access_t *p_access, int i_type )
return -1;
}
VLC_NORETURN
static void *KeepAliveThread( void *p_data )
{
access_t *p_access = p_data;
......
......@@ -1963,6 +1963,7 @@ static void TaskInterruptData( void *p_private )
/*****************************************************************************
*
*****************************************************************************/
VLC_NORETURN
static void* TimeoutPrevention( void *p_data )
{
timeout_thread_t *p_timeout = (timeout_thread_t *)p_data;
......
......@@ -112,6 +112,7 @@ static void Inhibit (vlc_inhibit_t *ih, bool suspend)
extern char **environ;
VLC_NORETURN
static void *Thread (void *data)
{
vlc_inhibit_t *ih = data;
......
......@@ -200,6 +200,7 @@ static void Close( vlc_object_t *p_this )
/*****************************************************************************
* Run: main thread
*****************************************************************************/
VLC_NORETURN
static void *Run( void *data )
{
services_discovery_t *p_sd = data;
......
......@@ -1018,6 +1018,7 @@ struct vlc_timer
vlc_atomic_t overruns;
};
VLC_NORETURN
static void *vlc_timer_thread (void *data)
{
struct vlc_timer *timer = data;
......
......@@ -170,6 +170,7 @@ static void AddressDestroy (sap_address_t *addr)
* \param p_this the SAP Handler object
* \return nothing
*/
VLC_NORETURN
static void *RunThread (void *self)
{
sap_address_t *addr = self;
......
......@@ -538,9 +538,7 @@ static void VoutDisplayEventMouse(vout_display_t *vd, int event, va_list args)
vlc_mutex_unlock(&osys->lock);
}
#ifdef __GNUC__
static void *VoutDisplayEventKeyDispatch(void *data) __attribute__((noreturn));
#endif
VLC_NORETURN
static void *VoutDisplayEventKeyDispatch(void *data)
{
vout_display_owner_sys_t *osys = data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment