public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* adding noreturn attribute to pthread_exit
@ 2013-01-14 20:55 Antti Kantee
  2013-01-14 21:18 ` Christopher Faylor
  0 siblings, 1 reply; 2+ messages in thread
From: Antti Kantee @ 2013-01-14 20:55 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: adding noreturn attribute to pthread_exit
  2013-01-14 20:55 adding noreturn attribute to pthread_exit Antti Kantee
@ 2013-01-14 21:18 ` Christopher Faylor
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Faylor @ 2013-01-14 21:18 UTC (permalink / raw)
  To: cygwin

On Mon, Jan 14, 2013 at 09:55:38PM +0100, Antti Kantee wrote:
>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);

I added a ChangeLog entry and checked this in.

Thanks for the patch.

cgf

--
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-14 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14 20:55 adding noreturn attribute to pthread_exit Antti Kantee
2013-01-14 21:18 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).