changeset 32094:f3d12359f0e4

lo-regexp.cc: Avoid unused variable warning with PCRE2. * liboctave/util/lo-regexp.cc (octave::regexp::match): Avoid warning about set but unused variable when building with PCRE2.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 13 May 2023 15:15:51 +0200
parents c409e2eeb9c7
children 28ef2991fb5a
files liboctave/util/lo-regexp.cc
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/util/lo-regexp.cc	Sat May 13 14:26:55 2023 +0200
+++ b/liboctave/util/lo-regexp.cc	Sat May 13 15:15:51 2023 +0200
@@ -488,7 +488,9 @@
 
           string_vector tokens (pos_match);
           string_vector named_tokens (m_names);
+#if ! defined (HAVE_PCRE2)
           int pos_offset = 0;
+#endif
           pos_match = 0;
 
           for (int i = 1; i < matches; i++)
@@ -532,8 +534,10 @@
                       tokens(pos_match++) = std::string (*(listptr+i), len);
 #endif
                     }
+#if ! defined (HAVE_PCRE2)
                   else
                     pos_offset++;
+#endif
                 }
             }