summaryrefslogtreecommitdiff
path: root/scope.h
diff options
context:
space:
mode:
authorJames E Keenan <jkeenan@cpan.org>2021-06-26 01:27:59 +0000
committerJames E Keenan <jkeenan@cpan.org>2021-07-05 11:38:19 +0000
commitf7b332245abf1aa8ca9c82cce454353f7b820adb (patch)
tree09f2711624b0c1b7022c103c2d44cc85dc202530 /scope.h
parent712b667820f97ab41da6f621f1bff8b790e158f5 (diff)
downloadperl-f7b332245abf1aa8ca9c82cce454353f7b820adb.tar.gz
Eliminate '-Wstring-compare' build-time warning in re_comp.c.
Per discussion with TonyC, use of the 'GCC' versions of two macros here is appropriate because that version is documented to handle CLANG as well. Using these macros preserves an optimization added in d0f83c3 in 2009. PR GH 18948 for issue GH 17015.
Diffstat (limited to 'scope.h')
-rw-r--r--scope.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/scope.h b/scope.h
index 49177e32a8..ba74c8bff5 100644
--- a/scope.h
+++ b/scope.h
@@ -208,9 +208,11 @@ scope has the given name. C<name> must be a literal string.
STMT_START { \
DEBUG_SCOPE("LEAVE \"" name "\"") \
if (PL_scopestack_name) { \
+ GCC_DIAG_IGNORE_STMT(-Wstring-compare); \
assert(((char*)PL_scopestack_name[PL_scopestack_ix-1] \
== (char*)name) \
|| strEQ(PL_scopestack_name[PL_scopestack_ix-1], name)); \
+ GCC_DIAG_RESTORE_STMT; \
} \
pop_scope(); \
} STMT_END