summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2016-06-22 10:41:05 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2016-06-22 10:41:05 +0000
commit636c8296e7e426e4fdbae4643e066b909597ea82 (patch)
tree8fc07e384abd02ea430b15f0b3647c3dc9ced999
parentb9aef69886369477cc18c398d0b1e47ceb191b9b (diff)
downloadpcre2-636c8296e7e426e4fdbae4643e066b909597ea82.tar.gz
Fix two compiler warnings from clang when only one code unit width is
supported. git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@531 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--ChangeLog3
-rw-r--r--src/pcre2test.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0774840..f397fc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -154,6 +154,9 @@ the same line" - but it was already over the end.
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
-----------------------------
diff --git a/src/pcre2test.c b/src/pcre2test.c
index b68cb82..b48b3e5 100644
--- a/src/pcre2test.c
+++ b/src/pcre2test.c
@@ -3754,6 +3754,10 @@ show_memory_info(void)
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 @@ if ((pat_patctl.control & (CTL_PUSH|CTL_PUSHCOPY)) != 0)
/* 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 @@ if (arg_error != NULL)
default:
printf("Unexpected return (%d) from pcre2_get_error_message()", len);
break;
- }
+ }
}
else
{