This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

adding noreturn attribute to pthread_exit


Hi,

Calling pthread_exit() at the end of a routine marked noreturn produces a compiler warning/error on cygwin:

error: 'noreturn' function does return

Is it possible to add the attribute to the cygwin pthread.h:

--- pthread.h.orig      2012-10-19 14:40:13.000000000 +0200
+++ pthread.h   2013-01-14 21:40:00.018198900 +0100
@@ -137,7 +137,7 @@
                    void *(*)(void *), void *);
 int pthread_detach (pthread_t);
 int pthread_equal (pthread_t, pthread_t);
-void pthread_exit (void *);
+void pthread_exit (void *) __attribute__((__noreturn__));
 int pthread_getcpuclockid (pthread_t, clockid_t *);
 int pthread_getschedparam (pthread_t, int *, struct sched_param *);
 void *pthread_getspecific (pthread_key_t);

(note, i didn't check how it needs to trickle down in the cygwin implementation of pthread_exit())

- antti

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]