[Pcre-svn] [531] code/trunk: Fix two compiler warnings from …

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [531] code/trunk: Fix two compiler warnings from clang when only one code unit width is
Revision: 531
          http://www.exim.org/viewvc/pcre2?view=rev&revision=531
Author:   ph10
Date:     2016-06-22 11:41:05 +0100 (Wed, 22 Jun 2016)
Log Message:
-----------
Fix two compiler warnings from clang when only one code unit width is 
supported.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2test.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2016-06-20 18:14:51 UTC (rev 530)
+++ code/trunk/ChangeLog    2016-06-22 10:41:05 UTC (rev 531)
@@ -154,7 +154,10 @@
 39. Allow \C in lookbehinds and DFA matching in UTF-32 mode (by converting it 
 to the same code as '.' when PCRE2_DOTALL is set).


+40. Fix two clang compiler warnings in pcre2test when only one code unit width
+is supported.

+
Version 10.21 12-January-2016
-----------------------------


Modified: code/trunk/src/pcre2test.c
===================================================================
--- code/trunk/src/pcre2test.c    2016-06-20 18:14:51 UTC (rev 530)
+++ code/trunk/src/pcre2test.c    2016-06-22 10:41:05 UTC (rev 531)
@@ -3754,6 +3754,10 @@
 uint32_t name_count, name_entry_size;
 size_t size, cblock_size;


+/* One of the test_mode values will always be true, but to stop a compiler
+warning we must initialize cblock_size. */
+
+cblock_size = 0;
#ifdef SUPPORT_PCRE2_8
if (test_mode == 8) cblock_size = sizeof(pcre2_real_code_8);
#endif
@@ -4856,9 +4860,7 @@

/* Convert the input in non-8-bit modes. */

-#ifdef SUPPORT_PCRE2_8
-if (test_mode == PCRE8_MODE) errorcode = 0;
-#endif
+errorcode = 0;

 #ifdef SUPPORT_PCRE2_16
 if (test_mode == PCRE16_MODE) errorcode = to16(pbuffer8, utf, &patlen);
@@ -7383,7 +7385,7 @@
         default:
         printf("Unexpected return (%d) from pcre2_get_error_message()", len);
         break;
-        } 
+        }
       }
     else
       {