summaryrefslogtreecommitdiff
path: root/pcre_compile.c
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-07-10 16:38:05 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-07-10 16:38:05 +0000
commitc632c7734805f249dd38be1c0bc1e47ab5520f5d (patch)
tree545b8f8f1cd42a8e74fe50cb3c85c21996ece307 /pcre_compile.c
parent85506d78d451291ac39e3fc1a7d02738c69423ae (diff)
downloadpcre-c632c7734805f249dd38be1c0bc1e47ab5520f5d.tar.gz
Avoid compiler warning for cast function argument.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1494 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_compile.c')
-rw-r--r--pcre_compile.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/pcre_compile.c b/pcre_compile.c
index c44839e..85d0e94 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -9277,11 +9277,18 @@ subpattern. */
if (errorcode == 0 && re->top_backref > re->top_bracket) errorcode = ERR15;
-/* Unless disabled, check whether single character iterators can be
-auto-possessified. The function overwrites the appropriate opcode values. */
+/* Unless disabled, check whether any single character iterators can be
+auto-possessified. The function overwrites the appropriate opcode values, so
+the type of the pointer must be cast. NOTE: the intermediate variable "temp" is
+used in this code because at least one compiler gives a warning about loss of
+"const" attribute if the cast (pcre_uchar *)codestart is used directly in the
+function call. */
if ((options & PCRE_NO_AUTO_POSSESS) == 0)
- auto_possessify((pcre_uchar *)codestart, utf, cd);
+ {
+ pcre_uchar *temp = (pcre_uchar *)codestart;
+ auto_possessify(temp, utf, cd);
+ }
/* If there were any lookbehind assertions that contained OP_RECURSE
(recursions or subroutine calls), a flag is set for them to be checked here,