This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use static asserts when comparing sizeof() to a constant
[perl5.git] / sv.c
diff --git a/sv.c b/sv.c
index 9c7f3ba..494b77c 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -12824,7 +12824,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
                          (!UVCHR_IS_INVARIANT(uv) && SvUTF8(sv)))
                         && !IN_BYTES)
                     {
-                        assert(sizeof(ebuf) >= UTF8_MAXBYTES + 1);
+                        STATIC_ASSERT_STMT(sizeof(ebuf) >= UTF8_MAXBYTES + 1);
                         eptr = ebuf;
                         elen = uvchr_to_utf8((U8*)eptr, uv) - (U8*)ebuf;
                         is_utf8 = TRUE;