diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2014-07-10 16:38:05 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2014-07-10 16:38:05 +0000 |
commit | c632c7734805f249dd38be1c0bc1e47ab5520f5d (patch) | |
tree | 545b8f8f1cd42a8e74fe50cb3c85c21996ece307 | |
parent | 85506d78d451291ac39e3fc1a7d02738c69423ae (diff) | |
download | pcre-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
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | pcre_compile.c | 13 |
2 files changed, 14 insertions, 3 deletions
@@ -81,6 +81,10 @@ Version 8.36 xx-xxx-2014 17. Fixed a number of memory leaks in pcregrep. +18. Avoid a compiler warning (from some compilers) for a function call with + a cast that removes "const" from an lvalue by using an intermediate + variable (to which the compiler does not object). + Version 8.35 04-April-2014 -------------------------- 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, |