Skip to content

Commit b411171

Browse files
jkbonfieldpd3
authored andcommitted
Work around an incompatibility between Perl and clang warnings.
Certain versions of perl trigger clang warnings about bracing: In file included from filter.c:55: ... /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:150:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] 150 | ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32' 80 | #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START { \ The perl headers can optionally omit the use of "({ statement })" in macros, so we use this so we can do clang builds with --enable-perl-filters without excessive warnings (or errors if using -Werror). Fixed in later perls. See also Perl/perl5#18780
1 parent 17b6563 commit b411171

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

filter.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ THE SOFTWARE. */
4545
#include "bcftools.h"
4646

4747
#if ENABLE_PERL_FILTERS
48+
// Work around clang warning problems
49+
# if defined(__clang__)
50+
# define PERL_GCC_BRACE_GROUPS_FORBIDDEN
51+
# endif
52+
4853
# define filter_t perl_filter_t
4954
# include <EXTERN.h>
5055
# include <perl.h>

0 commit comments

Comments
 (0)