From patchwork Wed Jun 5 20:21:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1944148 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DfNT8GK+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvf5m3drqz20Q5 for ; Thu, 6 Jun 2024 06:22:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E51CC3A50CC7 for ; Wed, 5 Jun 2024 20:22:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 81ACA396E079 for ; Wed, 5 Jun 2024 20:22:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81ACA396E079 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 81ACA396E079 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717618934; cv=none; b=rMnHAvfvnVQfqX6gAMXtHaNC+GP+SX3yjwo2TvqDBpMo8CgwfwdrU79vjVO8j1P0+sJ9qmwKCPMmINnHqXYRH1bNZI365D8+M4SIMeI69D7sKugIf6+lQDBuOTb69rt2dHC/mKASziJ1w2UGijK40EAPyoD4GiuY/gWldduLDlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717618934; c=relaxed/simple; bh=LbGJRZgwnA77ge8lJpLRdWVwEZZmbTiR1LJjOU6fb6U=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lD5ipgptBy/6iVcfTffj+xmbsEKWus8gUZMTEI+AudYprffwNRWRf8t0jhfKGSWm/umfwlJv0rH9Er2qkhvFwtdmPUojLrxGz/rJ9CA2UIj8totpox9t3vs+9EC4qsi60wpHGe7xfTSx8htv1I0Ohl6vWe6okpptgoHbPdLvn5s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717618932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TmwFshFsHLo/eTUtr/v7WcT0JAhb177V6hTMYbr3NxY=; b=DfNT8GK+o3rpSVXnDoF2CSSMfK6/syZlZB4SQjez+3iDk5lFhSt9T3f0YeME+0FU16bPgS xVtofXok8Xe3xpbOQUu78SEM0CSl80n0IlWL6zQXrn++BxrrckVON5h32YtGGDsTMr+GB4 +gQN5ZZKBumidX66mnaA+/WxEfC0ZNc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-532-t6JLU9jKOuiDnfIp19VRfQ-1; Wed, 05 Jun 2024 16:22:10 -0400 X-MC-Unique: t6JLU9jKOuiDnfIp19VRfQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1CCCA85A588 for ; Wed, 5 Jun 2024 20:22:10 +0000 (UTC) Received: from localhost (unknown [10.39.192.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE02E2166AF9; Wed, 5 Jun 2024 20:22:09 +0000 (UTC) From: Jonathan Wakely To: gcc-patches@gcc.gnu.org Cc: amacleod@sourceware.org Subject: [PATCH 2/2] contrib: Fix 'invalid escape sequence' warnings in header-tools Date: Wed, 5 Jun 2024 21:21:25 +0100 Message-ID: <20240605202207.163176-2-jwakely@redhat.com> In-Reply-To: <20240605202207.163176-1-jwakely@redhat.com> References: <20240605202207.163176-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org OK for trunk? -- >8 -- Use raw strings so that backslashes don't need to be escaped. Otherwise the Python interpreter warns. contrib/header-tools/ChangeLog: * headerutils.py (is_pound_if, is_pound_endif): Use raw strings for strings containing backslashes. * included-by: Likewise. --- contrib/header-tools/headerutils.py | 6 +++--- contrib/header-tools/included-by | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/header-tools/headerutils.py b/contrib/header-tools/headerutils.py index 1fb02214414..966892ad382 100755 --- a/contrib/header-tools/headerutils.py +++ b/contrib/header-tools/headerutils.py @@ -35,15 +35,15 @@ def find_pound_define (line): return "" def is_pound_if (line): - inc = re.findall ("^\s*#\s*if\s", line) + inc = re.findall (r"^\s*#\s*if\s", line) if not inc: - inc = re.findall ("^\s*#\s*if[n]?def\s", line) + inc = re.findall (r"^\s*#\s*if[n]?def\s", line) if inc: return True return False def is_pound_endif (line): - inc = re.findall ("^\s*#\s*endif", line) + inc = re.findall (r"^\s*#\s*endif", line) if inc: return True return False diff --git a/contrib/header-tools/included-by b/contrib/header-tools/included-by index b953825f0b1..f0c8eaa600c 100755 --- a/contrib/header-tools/included-by +++ b/contrib/header-tools/included-by @@ -61,10 +61,10 @@ if len(src) == 0: if not usage: if scanfiles: if process_h: - file_list = find_gcc_files ("\*.h", current, deeper) + file_list = find_gcc_files (r"\*.h", current, deeper) if process_c: - file_list = file_list + find_gcc_files ("\*.c", current, deeper) - file_list = file_list + find_gcc_files ("\*.cc", current, deeper) + file_list = file_list + find_gcc_files (r"\*.c", current, deeper) + file_list = file_list + find_gcc_files (r"\*.cc", current, deeper) else: newlist = list() for x in file_list: