delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/01/14/15:56:02

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <50F470CA.5030400@iki.fi>
Date: Mon, 14 Jan 2013 21:55:38 +0100
From: Antti Kantee <pooka AT iki DOT fi>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: adding noreturn attribute to pthread_exit
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019