From 3d1c4d8b006d0c1d01e22169a4db20c266592baf Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Mon, 18 Nov 2013 15:41:45 +0000 Subject: [PATCH] threads: silence some compiler warnings. From 5.8.9, the MGVTBL struct has a 'svt_local' member Declare some vars volatile within a function that uses jongjmp Mark the unused return value from PerlLIO_write() as void(), even though it won't shut up gcc. --- dist/threads/lib/threads.pm | 2 +- dist/threads/threads.xs | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dist/threads/lib/threads.pm b/dist/threads/lib/threads.pm index f2517be..5a706f1 100644 --- a/dist/threads/lib/threads.pm +++ b/dist/threads/lib/threads.pm @@ -5,7 +5,7 @@ use 5.008; use strict; use warnings; -our $VERSION = '1.89'; +our $VERSION = '1.90'; my $XS_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/dist/threads/threads.xs b/dist/threads/threads.xs index 49bf483..b3e10f0 100644 --- a/dist/threads/threads.xs +++ b/dist/threads/threads.xs @@ -390,7 +390,10 @@ MGVTBL ithread_vtbl = { 0, /* clear */ ithread_mg_free, /* free */ 0, /* copy */ - ithread_mg_dup /* dup */ + ithread_mg_dup, /* dup */ +#if (PERL_VERSION > 8) || (PERL_VERSION == 8 && PERL_SUBVERSION > 8) + 0 /* local */ +#endif }; @@ -468,8 +471,8 @@ S_ithread_run(void * arg) ithread *thread = (ithread *)arg; int jmp_rc = 0; I32 oldscope; - int exit_app = 0; /* Thread terminated using 'exit' */ - int exit_code = 0; + volatile int exit_app = 0; /* Thread terminated using 'exit' */ + volatile int exit_code = 0; int died = 0; /* Thread terminated abnormally */ dJMPENV; @@ -496,7 +499,7 @@ S_ithread_run(void * arg) { AV *params = thread->params; - int len = (int)av_len(params)+1; + volatile int len = (int)av_len(params)+1; int ii; dSP; @@ -711,7 +714,8 @@ S_ithread_create( PERL_SET_CONTEXT(aTHX); if (!thread) { MUTEX_UNLOCK(&MY_POOL.create_destruct_mutex); - PerlLIO_write(PerlIO_fileno(Perl_error_log), PL_no_mem, strlen(PL_no_mem)); + (void)PerlLIO_write(PerlIO_fileno(Perl_error_log), + PL_no_mem, strlen(PL_no_mem)); my_exit(1); } Zero(thread, 1, ithread); -- 2.7.4