From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7bCtH8xUd1/CMAAAWB0awg (envelope-from ) for ; Fri, 02 Oct 2020 12:26:52 -0400 Received: by simark.ca (Postfix, from userid 112) id 748D81EF44; Fri, 2 Oct 2020 12:26:52 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9CBFD1E590 for ; Fri, 2 Oct 2020 12:26:51 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A58C6386F036; Fri, 2 Oct 2020 16:26:50 +0000 (GMT) Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTP id 63B7F386F01D for ; Fri, 2 Oct 2020 16:26:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 63B7F386F01D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 370B91179E4; Fri, 2 Oct 2020 12:26:49 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QrQ4ieZs+DM1; Fri, 2 Oct 2020 12:26:49 -0400 (EDT) Received: from murgatroyd.Home (174-16-122-38.hlrn.qwest.net [174.16.122.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id E7E10117851; Fri, 2 Oct 2020 12:26:48 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH] Unconditionally use REG_EXTENDED Date: Fri, 2 Oct 2020 10:26:47 -0600 Message-Id: <20201002162647.1368664-1-tromey@adacore.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Tromey Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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. gdb/ChangeLog 2020-10-02 Tom Tromey * skip.c (skiplist_entry::skiplist_entry): Unconditionally use REG_EXTENDED. --- gdb/ChangeLog | 5 +++++ gdb/skip.c | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gdb/skip.c b/gdb/skip.c index 419dd7a4682..e6499d619c7 100644 --- a/gdb/skip.c +++ b/gdb/skip.c @@ -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")); } } -- 2.26.2