From: Tony Cook Date: Tue, 15 Mar 2016 00:26:26 +0000 (+1100) Subject: avoid generating an empty statement outside a function on non-clang X-Git-Tag: v5.23.9~38 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/d60341990a480cabcbb36cbfde9bfcae6738f419?hp=ce12e2548182b5bf6788188c520311eef0eca0ca avoid generating an empty statement outside a function on non-clang On non-clang compilers, the code: CLANG_DIAG_RESTORE; outside a function generated a simple empty statement (or empty declaration), which is invalid syntax outside a function in C, causing a warning from the solaris studio compiler. --- diff --git a/dist/threads/threads.xs b/dist/threads/threads.xs index 891d4d1..d35eee1 100644 --- a/dist/threads/threads.xs +++ b/dist/threads/threads.xs @@ -1021,7 +1021,9 @@ S_ithread_create( CLANG_DIAG_IGNORE(-Wthread-safety); /* warning: mutex 'thread->mutex' is not held on every path through here [-Wthread-safety-analysis] */ } +#if defined(__clang__) || defined(__clang) CLANG_DIAG_RESTORE; +#endif #endif /* USE_ITHREADS */