Skip to content

Commit

Permalink
Suppress some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
NWilson committed Jan 13, 2025
1 parent a7b3e61 commit 1ce8525
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pcre2_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8115,6 +8115,7 @@ for (;; pptr++)
cb->external_flags |= PCRE2_HASBKC; /* Record */
#if PCRE2_CODE_UNIT_WIDTH == 32
meta_arg = OP_ALLANY;
(void)utf; /* Avoid compiler warning. */
#else
if (!utf) meta_arg = OP_ALLANY;
#endif
Expand Down
11 changes: 11 additions & 0 deletions src/pcre2_compile_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ if (xoptions & PCRE2_EXTRA_CASELESS_RESTRICT)

if (xoptions & PCRE2_EXTRA_TURKISH_CASING)
class_options |= PARSE_CLASS_TURKISH_UTF;
#else
(void)options; /* Avoid compiler warning. */
(void)xoptions; /* Avoid compiler warning. */
#endif

/* Compute required space for the range. */
Expand Down Expand Up @@ -904,6 +907,10 @@ uint8_t *classbits = cb->classbits.classbits;
uint32_t c, byte_start, byte_end;
uint32_t classbits_end = (end <= 0xff ? end : 0xff);

#ifndef SUPPORT_UNICODE
(void)xoptions; /* Avoid compiler warning. */
#endif

/* If caseless matching is required, scan the range and process alternate
cases. In Unicode, there are 8-bit characters that have alternate cases that
are greater than 255 and vice-versa (though these may be ignored if caseless
Expand Down Expand Up @@ -1079,6 +1086,10 @@ BOOL utf = FALSE;
uint32_t xclass_props;
PCRE2_UCHAR *class_uchardata;
class_ranges* cranges;
#else
(void)has_bitmap; /* Avoid compiler warning. */
(void)errorcodeptr; /* Avoid compiler warning. */
(void)lengthptr; /* Avoid compiler warning. */
#endif

/* If an XClass contains a negative special such as \S, we need to flip the
Expand Down
2 changes: 2 additions & 0 deletions src/pcre2_jit_char_inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ BOOL has_cmov, last_range_set;
sljit_u32 category_list = 0;
sljit_u32 items;
int typereg = TMP1;
#else
(void)c; /* Avoid compiler warning. */
#endif /* SUPPORT_UNICODE */

SLJIT_ASSERT(common->locals_size >= SSIZE_OF(sw));
Expand Down
4 changes: 4 additions & 0 deletions src/pcre2_match.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ PCRE2_SIZE length;
PCRE2_SPTR eptr;
PCRE2_SPTR eptr_start;

#ifndef SUPPORT_UNICODE
(void)caseopts; /* Avoid compiler warning. */
#endif

/* Deal with an unset group. The default is no match, but there is an option to
match an empty string. */

Expand Down

0 comments on commit 1ce8525

Please sign in to comment.