From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.lisp.guile.devel Subject: Re: Avoid warnings in threads.c when building without threads Date: Fri, 22 Jul 2016 10:16:30 +0300 Message-ID: <838twuxhv5.fsf@gnu.org> References: <834m7p5wy1.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1469171802 20759 80.91.229.3 (22 Jul 2016 07:16:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Jul 2016 07:16:42 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jul 22 09:16:42 2016 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQUhM-0001kA-0C for guile-devel@m.gmane.org; Fri, 22 Jul 2016 09:16:40 +0200 Original-Received: from localhost ([::1]:45520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQUhK-0005eD-RP for guile-devel@m.gmane.org; Fri, 22 Jul 2016 03:16:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQUhA-0005bC-QY for guile-devel@gnu.org; Fri, 22 Jul 2016 03:16:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQUh5-0006TB-9m for guile-devel@gnu.org; Fri, 22 Jul 2016 03:16:28 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQUh5-0006Sm-6Z for guile-devel@gnu.org; Fri, 22 Jul 2016 03:16:23 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1413 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQUh3-00029Q-Bb for guile-devel@gnu.org; Fri, 22 Jul 2016 03:16:21 -0400 In-reply-to: <834m7p5wy1.fsf@gnu.org> (message from Eli Zaretskii on Sat, 16 Jul 2016 20:12:22 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18593 Archived-At: Ping! > Date: Sat, 16 Jul 2016 20:12:22 +0300 > From: Eli Zaretskii > > CC libguile_2.0_la-threads.lo > In file included from ../libguile/threads.h:40:0, > from ../libguile/gc.h:30, > from ../libguile/_scm.h:76, > from threads.c:28: > threads.c: In function 'scm_call_with_new_thread': > ../libguile/null-threads.h:74:53: warning: right-hand operand of comma expression has no effect [-Wunused-value] > #define scm_i_pthread_cond_wait(c,m) (abort(), 0) > ^ > ../libguile/null-threads.h:102:45: note: in expansion of macro 'scm_i_pthread_cond_wait' > #define scm_i_scm_pthread_cond_wait scm_i_pthread_cond_wait > ^ > threads.c:1061:5: note: in expansion of macro 'scm_i_scm_pthread_cond_wait' > scm_i_scm_pthread_cond_wait (&data.cond, &data.mutex); > ^ > > The patch to shut up these warnings is below. OK to commit? > > --- libguile/null-threads.h~0 2016-01-02 13:32:40.000000000 +0200 > +++ libguile/null-threads.h 2016-07-15 17:47:37.101375000 +0300 > @@ -43,7 +43,7 @@ > #define scm_i_pthread_create(t,a,f,d) (*(t)=0, (void)(f), ENOSYS) > #define scm_i_pthread_detach(t) do { } while (0) > #define scm_i_pthread_exit(v) exit (EXIT_SUCCESS) > -#define scm_i_pthread_cancel(t) 0 > +#define scm_i_pthread_cancel(t) (void)0 > #define scm_i_pthread_cleanup_push(t,v) 0 > #define scm_i_pthread_cleanup_pop(e) 0 > #define scm_i_sched_yield() 0 > > > --- libguile/threads.c~ 2016-06-20 23:35:06.000000000 +0300 > +++ libguile/threads.c 2016-07-15 17:48:20.757625000 +0300 > @@ -1058,7 +1058,7 @@ SCM_DEFINE (scm_call_with_new_thread, "c > } > > while (scm_is_false (data.thread)) > - scm_i_scm_pthread_cond_wait (&data.cond, &data.mutex); > + (void)scm_i_scm_pthread_cond_wait (&data.cond, &data.mutex); > > scm_i_pthread_mutex_unlock (&data.mutex); > > @@ -1138,7 +1138,7 @@ scm_spawn_thread (scm_t_catch_body body, > } > > while (scm_is_false (data.thread)) > - scm_i_scm_pthread_cond_wait (&data.cond, &data.mutex); > + (void)scm_i_scm_pthread_cond_wait (&data.cond, &data.mutex); > > scm_i_pthread_mutex_unlock (&data.mutex); > > >