[vlc-devel] [PATCH] Define functions that are known not to return a value as such, using __attribute__ ((__noreturn__)).

Dominique Leuenberger dominique at leuenberger.net
Tue May 4 01:53:12 CEST 2010


---
 modules/access/mms/mmstu.c |    2 +-
 modules/control/netsync.c  |    2 +-
 modules/control/signals.c  |    2 +-
 modules/demux/live555.cpp  |    2 +-
 modules/stream_out/rtp.c   |    2 +-
 src/modules/cache.c        |    1 +
 6 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c
index 45e363d..62e8f8e 100644
--- a/modules/access/mms/mmstu.c
+++ b/modules/access/mms/mmstu.c
@@ -1554,7 +1554,7 @@ static int mms_HeaderMediaRead( access_t *p_access, int i_type )
     return -1;
 }
 
-static void *KeepAliveThread( void *p_data )
+static void *KeepAliveThread( void *p_data ) __attribute__ ((__noreturn__))
 {
     access_t *p_access = p_data;
 
diff --git a/modules/control/netsync.c b/modules/control/netsync.c
index 455be18..0f51318 100644
--- a/modules/control/netsync.c
+++ b/modules/control/netsync.c
@@ -211,7 +211,7 @@ static void *Master(void *handle)
     }
 }
 
-static void *Slave(void *handle)
+static void *Slave(void *handle) __attribute__ ((__noreturn__))
 {
     intf_thread_t *intf = handle;
     intf_sys_t *sys = intf->p_sys;
diff --git a/modules/control/signals.c b/modules/control/signals.c
index 5cb6f36..1b35338 100644
--- a/modules/control/signals.c
+++ b/modules/control/signals.c
@@ -94,7 +94,7 @@ static bool ignored (int signum)
             ? (void *)sa.sa_sigaction : (void *)sa.sa_handler) == SIG_IGN;
 }
 
-static void *SigThread (void *data)
+static void *SigThread (void *data) __attribute__ ((__noreturn__))
 {
     intf_thread_t *obj = data;
     sigset_t set;
diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp
index e6fab0a..4643497 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -1880,7 +1880,7 @@ static void TaskInterrupt( void *p_private )
 /*****************************************************************************
  *
  *****************************************************************************/
-static void* TimeoutPrevention( void *p_data )
+static void* TimeoutPrevention( void *p_data ) __attribute__ ((__noreturn__))
 {
     timeout_thread_t *p_timeout = (timeout_thread_t *)p_data;
 
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index ab3907b..295317b 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -1655,7 +1655,7 @@ static void* ThreadSend( void *data )
 
 
 /* This thread dequeues incoming connections (DCCP streaming) */
-static void *rtp_listen_thread( void *data )
+static void *rtp_listen_thread( void *data ) __attribute__ ((__noreturn__))
 {
     sout_stream_id_t *id = data;
 
diff --git a/src/modules/cache.c b/src/modules/cache.c
index 3f09ad8..2ff05ae 100644
--- a/src/modules/cache.c
+++ b/src/modules/cache.c
@@ -330,6 +330,7 @@ void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, const char *dir )
  * It is only used as a non-NULL vlc_callback_t value for comparison. */
 static int dummy_callback (vlc_object_t *obj, const char *name,
                            vlc_value_t oldval, vlc_value_t newval, void *data)
+           __attribute__ ((__noreturn__))
 {
     (void) obj; (void)name; (void)oldval; (void)newval; (void)data;
     assert (0);
-- 
1.6.0.2




More information about the vlc-devel mailing list