This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid generating an empty statement outside a function on non-clang
authorTony Cook <tony@develop-help.com>
Tue, 15 Mar 2016 00:26:26 +0000 (11:26 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 15 Mar 2016 00:26:26 +0000 (11:26 +1100)
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.

dist/threads/threads.xs

index 891d4d1..d35eee1 100644 (file)
@@ -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 */