[pcre-dev] [Bug 2474] New: Fix a few warnings reported by Vi…

Top Page
Delete this message
Author: admin
Date:  
To: pcre-dev
New-Topics: [pcre-dev] [Bug 2474] Fix a few warnings reported by Visual Studio
Subject: [pcre-dev] [Bug 2474] New: Fix a few warnings reported by Visual Studio
https://bugs.exim.org/show_bug.cgi?id=2474

            Bug ID: 2474
           Summary: Fix a few warnings reported by Visual Studio
           Product: PCRE
           Version: 10.34 (PCRE2)
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: wishlist
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: lucas.trzesniewski@???
                CC: pcre-dev@???


I maintain PCRE.NET, which is a library that provides bindings to PCRE for .NET
languages like C#.

I use Visual Studio to compile the library for Windows in UTF-16 mode, and it
reported a warning since a few versions, but there are now a couple more
warnings since v10.34. Maybe those are false alerts, I didn't really check, but
I hoped I could get the fixes integrated into PCRE instead of reapplying my
patches every time.

Apparently you don't provide any way to contribute code changes, so I'll just
put them here.

1. pcre2_match.c, line 577: VS says that assert_accept_frame could be
potentially read while uninitialized.
- heapframe *assert_accept_frame; /* For passing back the frame with captures
*/
+ heapframe *assert_accept_frame = NULL; /* For passing back the frame with
captures */

2. pcre2_jit_compile.c, line 12875: same warning for put_label.
- struct sljit_put_label *put_label;
+ struct sljit_put_label *put_label = NULL;

3. pcre2_jit_compile.c, line 5547: in x86 only, VS reports a signed/unsigned
mismatch on the >= operator. Both operands are unsigned, but I suppose that
some integer promotion is going on here (my C is a bit rusty). I solved it with
a cast but maybe there's a better method.
- if (b_pri > 2 && a_pri + b_pri >= max_pri)
+ if (b_pri > 2 && (sljit_u32)a_pri + b_pri >= max_pri)

Thanks!

--
You are receiving this mail because:
You are on the CC list for the bug.