Unconditionally use REG_EXTENDED
authorTom Tromey <tromey@adacore.com>
Fri, 2 Oct 2020 16:23:25 +0000 (10:23 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 2 Oct 2020 20:08:28 +0000 (14:08 -0600)
skip.c checks whether REG_EXTENDED is defined -- but this should
always be available, and is used unconditionally in other parts of
gdb.  This patch removes this check, then further simplifies this
code, removing a declaration and a repeated assertion.

2020-10-02  Tom Tromey  <tromey@adacore.com>

* skip.c (skiplist_entry::skiplist_entry): Unconditionally use
REG_EXTENDED.

gdb/ChangeLog
gdb/skip.c

index ca7a0caae5c90de4e7be890f165f17b6e6062a79..0e8bbe3bee4910df7a5addf09dd6ca4b90a70956 100644 (file)
@@ -1,3 +1,8 @@
+2020-10-02  Tom Tromey  <tromey@adacore.com>
+
+       * skip.c (skiplist_entry::skiplist_entry): Unconditionally use
+       REG_EXTENDED.
+
 2020-10-02  Simon Marchi  <simon.marchi@efficios.com>
 
        * aix-thread.c (aix_thread_inferior_created): Remove parameters.
index 419dd7a46821f4f7f34087956ed432e82322159a..e6499d619c7431dffade1b81691d3b72de76f171 100644 (file)
@@ -139,14 +139,8 @@ skiplist_entry::skiplist_entry (bool file_is_glob,
   if (m_function_is_regexp)
     {
       gdb_assert (!m_function.empty ());
-
-      int flags = REG_NOSUB;
-#ifdef REG_EXTENDED
-      flags |= REG_EXTENDED;
-#endif
-
-      gdb_assert (!m_function.empty ());
-      m_compiled_function_regexp.emplace (m_function.c_str (), flags,
+      m_compiled_function_regexp.emplace (m_function.c_str (),
+                                         REG_NOSUB | REG_EXTENDED,
                                          _("regexp"));
     }
 }