From patchwork Wed Jun 5 20:21:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1944149 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=cKQZWQQ2; 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 4Vvf5m5PgFz20Wh 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 E09E739D9454 for ; Wed, 5 Jun 2024 20:22:34 +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.129.124]) by sourceware.org (Postfix) with ESMTPS id 8E46839D9447 for ; Wed, 5 Jun 2024 20:22:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E46839D9447 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 8E46839D9447 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717618934; cv=none; b=HQWV6DpI4j+pGXe1pIa6uabGL/t4nSdKlWY9TxiGw4cq92LYWa9BL9II7j82HW8InNFI8pKcMC16uayJvjZXtzcUENfebbQ80L8xP/Qi76q7i1ciLJFMGddvtQk240LT+hK26yLMqlGxluN1L9/Z8eR6jl7YovaaJlS/fT7R/y4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717618934; c=relaxed/simple; bh=tGCJ2qMiMeUAl5sKVPQrXDEtyzor19Zt8J6KCbDkraM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=E2u2V3izet9eZx93AEj06/o0k62ze3JXNgHI8JVgFiFDxq7XgOYblWbMy1DIRlDyO3hCnlIqm6iFtrZSDBUo/Y4nMpvC1Yk40h06tliWGxrKm2aOEOyNv+NBS4mGMkaQI/lwhvbtvUMVIYSv0/+jgAgfNeDm+ZfEn10q2FkZjYk= 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; bh=y+YbSnNNFdWlyjtwjzJdASDf8PAUWIvytOeWpfe8Qxc=; b=cKQZWQQ273TqDfWy1c02+j4o0X6/PiHdtdhUb4ahwAOLQGff7uB0h4nzngnRaTRE/vVSoD FjPeOGo2JTSt5/GX00M2v2vgkYrwXs3VeMMGN4VCu+hon4ah8eM1NHawHwAb8k6ZnqZfS7 s7fTHdVFlPszT8cB+WYYlbch+OAM5ck= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-jYCqsg41PwmUo0s5s-oqpw-1; Wed, 05 Jun 2024 16:22:09 -0400 X-MC-Unique: jYCqsg41PwmUo0s5s-oqpw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 0A9033C025B2 for ; Wed, 5 Jun 2024 20:22:09 +0000 (UTC) Received: from localhost (unknown [10.39.192.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5DED1C06701; Wed, 5 Jun 2024 20:22:08 +0000 (UTC) From: Jonathan Wakely To: gcc-patches@gcc.gnu.org Cc: amacleod@sourceware.org Subject: [PATCH 1/2] contrib: Fix KeyError errors in header-tools/gcc-order-headers Date: Wed, 5 Jun 2024 21:21:24 +0100 Message-ID: <20240605202207.163176-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 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 -- This change fixes the following two errors: Traceback (most recent call last): File "../contrib/header-tools/gcc-order-headers", line 267, in process_known_dups () File "../contrib/header-tools/gcc-order-headers", line 101, in process_known_dups if dups[i] and "rtl.h" in dups[i]: ~~~~^^^ KeyError: 'insn-modes.h' Traceback (most recent call last): File "../contrib/header-tools/gcc-order-headers", line 267, in process_known_dups () File "../contrib/header-tools/gcc-order-headers", line 103, in process_known_dups if not dups[i]: ~~~~^^^ KeyError: 'insn-modes.h' Use 'if i in dups' to check whether the key is present in the dict. contrib/header-tools/ChangeLog: * gcc-order-headers (process_known_dups): Check if key is in dict before accessing it. --- contrib/header-tools/gcc-order-headers | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/header-tools/gcc-order-headers b/contrib/header-tools/gcc-order-headers index 87fdddf60ee..85144cbd67b 100755 --- a/contrib/header-tools/gcc-order-headers +++ b/contrib/header-tools/gcc-order-headers @@ -98,10 +98,11 @@ def process_known_dups (): rtl_remove = includes["coretypes.h"][1] + ["statistics.h", "vec.h"] if dups: for i in rtl_remove: - if dups[i] and "rtl.h" in dups[i]: - dups[i].remove("rtl.h") - if not dups[i]: - dups.pop (i, None) + if i in dups: + if "rtl.h" in dups[i]: + dups[i].remove("rtl.h") + if not dups[i]: + dups.pop (i, None) # make sure diagnostic.h is the owner of diagnostic-core.h if includes["diagnostic-core.h"][0] != "diagnostic.h": 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: