diff options
author | Tony Cook <tony@develop-help.com> | 2021-07-15 13:13:03 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2021-07-15 13:13:03 +1000 |
commit | 7169efc77525df70484a824bff4ceebd1fafc760 (patch) | |
tree | 36fbc3a0beb384f5eb77a533bedfb5e8b4c6ab92 | |
parent | 7ffb9e762a2e972f46cd37962bd0aae40a4e7e3b (diff) | |
download | perl-7169efc77525df70484a824bff4ceebd1fafc760.tar.gz |
skip using gcc brace groups for STMT_START/END
This warns (and warns a lot) on clang, and since these are documented
to only work to make a single statement, so there's little value to
allowing them to work in an expression.
An alternative would be to disable GCC brace groups on clang, but
these are used extensively in DEBUGGING builds to add extra checks
in sv.h.
-rw-r--r-- | dist/Devel-PPPort/parts/inc/misc | 9 | ||||
-rw-r--r-- | perl.h | 5 |
2 files changed, 2 insertions, 12 deletions
diff --git a/dist/Devel-PPPort/parts/inc/misc b/dist/Devel-PPPort/parts/inc/misc index 9ec0a04df2..e62f3a7c64 100644 --- a/dist/Devel-PPPort/parts/inc/misc +++ b/dist/Devel-PPPort/parts/inc/misc @@ -248,17 +248,12 @@ __UNDEF_NOT_PROVIDED__ PERL_GCC_BRACE_GROUPS_FORBIDDEN #undef STMT_START #undef STMT_END -#ifdef PERL_USE_GCC_BRACE_GROUPS -# define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */ -# define STMT_END ) -#else -# if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) +#if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) # define STMT_START if (1) # define STMT_END else (void)0 -# else +#else # define STMT_START do # define STMT_END while (0) -# endif #endif __UNDEFINED__ boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no) @@ -734,13 +734,8 @@ Example usage: Trying to select a version that gives no warnings... */ #if !(defined(STMT_START) && defined(STMT_END)) -# ifdef PERL_USE_GCC_BRACE_GROUPS -# define STMT_START (void)( /* gcc supports "({ STATEMENTS; })" */ -# define STMT_END ) -# else # define STMT_START do # define STMT_END while (0) -# endif #endif #ifndef BYTEORDER /* Should never happen -- byteorder is in config.h */ |