develooper Front page | perl.perl5.porters | Postings from November 2014

Battle the warnings: add missing cast

Thread Next
From:
Martijn Lievaart
Date:
November 15, 2014 18:34
Subject:
Battle the warnings: add missing cast
Message ID:
54679C90.3060300@rtij.nl
Author: Martijn Lievaart <m@rtij.nl>
Date:   Sat Nov 15 19:31:47 2014 +0100

     Add missing cast from U8* to char* when calling memcmp

diff --git a/toke.c b/toke.c
index 74dd1c1..9d2b9aa 100644
--- a/toke.c
+++ b/toke.c
@@ -10721,7 +10721,7 @@ S_swallow_bom(pTHX_ U8 *s)
         break;
      case BOM_UTF8_FIRST_BYTE: {
          const STRLEN len = sizeof(BOM_UTF8_TAIL) - 1; /* Exclude 
trailing NUL */
-        if (slen > len && memEQ(s+1, BOM_UTF8_TAIL, len)) {
+        if (slen > len && memEQ((char *)s+1, BOM_UTF8_TAIL, len)) {
              if (DEBUG_p_TEST || DEBUG_T_TEST) 
PerlIO_printf(Perl_debug_log, "UTF-8 script encoding (BOM)\n");
              s += len + 1;                      /* UTF-8 */
          }


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About