Re: [pcre-dev] MSVC (win32) warnings with jit compiler

トップ ページ
このメッセージを削除
著者: Zoltán Herczeg
日付:  
To: Evgeny Grin
CC: pcre-dev
題目: Re: [pcre-dev] MSVC (win32) warnings with jit compiler
Hi,

thanks for the report. Fixed in:
http://www.exim.org/lurker/message/20130829.134049.0c8cdd27.en.html

Btw you cannot remove the before OVECTOR(0), since its value is not zero.

Regards,
Zoltan

Evgeny Grin <k2k@???> írta:
>HI!>
>

I have two warnings on MSVC 2010 for pcre_jit_compile.c for 2 lines>
      OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -OVECTOR(0));>

>

"warning C4146: unary minus operator applied to unsigned type, result still unsigned">
>

I eliminate warnings with simple patch>
>
>

--- pcre_jit_compile.c.orig    2013-05-10 18:04:21 +0400>
+++ pcre_jit_compile.c    2013-08-25 01:16:38 +0400>
@@ -481,7 +481,7 @@ to characters. The vector data is divide>
 group contains the start / end character pointers, and the second is>
 the start pointers when the end of the capturing group has not yet reached. */>
 #define OVECTOR_START    (common->ovector_start)>
-#define OVECTOR(i)       (OVECTOR_START + (i) * sizeof(sljit_sw))>
+#define OVECTOR(i)       (OVECTOR_START + (i) * (sljit_sw)sizeof(sljit_sw))>
 #define OVECTOR_PRIV(i)  (common->cbra_ptr + (i) * sizeof(sljit_sw))>
 #define PRIVATE_DATA(cc) (common->private_data_ptrs[(cc) - common->start])>

>
>

BTW warnings are wrong!>
I ran pcre_jit_test compiled with original code and had succes.>
Then I just removed minus from code compile it again and pcre_jit_test compiled ended with error.>
With my patch test works just fine.>
>

Best Wishes,>
Evgeny>
>

-- >
## List details at https://lists.exim.org/mailman/listinfo/pcre-dev >