unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Avoid warnings in threads.c when building without threads
@ 2016-07-16 17:12 Eli Zaretskii
  2016-07-22  7:16 ` Eli Zaretskii
  2016-07-23 20:49 ` Andy Wingo
  0 siblings, 2 replies; 5+ messages in thread
From: Eli Zaretskii @ 2016-07-16 17:12 UTC (permalink / raw)
  To: guile-devel

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



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

end of thread, other threads:[~2016-07-24 13:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-16 17:12 Avoid warnings in threads.c when building without threads Eli Zaretskii
2016-07-22  7:16 ` Eli Zaretskii
2016-07-23 20:49 ` Andy Wingo
2016-07-24  2:38   ` Eli Zaretskii
2016-07-24 13:32     ` Andy Wingo

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