This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Silence a compiler warning
authorKarl Williamson <khw@cpan.org>
Sat, 15 Oct 2016 17:00:57 +0000 (11:00 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 16 Oct 2016 16:47:00 +0000 (10:47 -0600)
Some compilers wrongly warn that this is used uninitialized.

utf8.c

diff --git a/utf8.c b/utf8.c
index 729650d..fb3acad 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -997,7 +997,8 @@ Perl_utf8n_to_uvchr_error(pTHX_ const U8 *s,
      * too short one.  Otherwise the first two are set to 's0' and 'send', and
      * the third not used at all */
     U8 * adjusted_s0 = (U8 *) s0;
-    U8 * adjusted_send;
+    U8 * adjusted_send = NULL;  /* (Initialized to silence compilers' wrong
+                                   warning) */
     UV uv_so_far = 0;   /* (Initialized to silence compilers' wrong warning) */
 
     PERL_ARGS_ASSERT_UTF8N_TO_UVCHR_ERROR;