From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 13BA63858288 for ; Fri, 31 Mar 2023 20:21:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 13BA63858288 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680294067; 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=hEBeEpnkTekLZx8VA5n2Ipezf0mceywacuDV6up3HvE=; b=KG6o9ZCnEz41G0XrGDRL48WAFOowB7nIJnm5NhqaWJiv8hOqVo19vp/6mz8Z2n7cvvIARL 1b9FxV7vqMfIXA+JQfFYEin52c4s2sgq7hGHIj+pmz3hOT5AfiJGmObpVjEXCFtgXi2JXV jT+Ea2l0zK43NFXF9miqLVp0qVLxQ3k= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-3YXjkXWCOUKfiAt7RHVRaw-1; Fri, 31 Mar 2023 16:21:06 -0400 X-MC-Unique: 3YXjkXWCOUKfiAt7RHVRaw-1 Received: by mail-wm1-f69.google.com with SMTP id e5-20020a05600c4e4500b003edc5824521so12582640wmq.0 for ; Fri, 31 Mar 2023 13:21:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680294064; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hEBeEpnkTekLZx8VA5n2Ipezf0mceywacuDV6up3HvE=; b=GRNb/X9cAdNmw8KnaGnxaKxvFFLHWVHROxU3XT93s8YXKOBzFnak8WQkI37om8qCoU 4m3OA7zjbmw64vp3hYBtOiKZHH+DT2u+3Mu5BXNmWyG+anCRyURLcY2nhIJgnnQy6aWC qvn6zHjUF7JyGHeA4QG5A3B+WN7wUpaPOTITrXg3Vw5ZCGXgls6nkkqtVsMHtKpiRTA7 5IJy+Xsl2JZx6hiWz8acdBh9auVcIq3j9pHPUdw/92R2Vw4vSuD1Tw1pPYte2V59veqx GqtOXTHrl0iY7cibTY+7tRnzpHahc3KgSRLXqKIXXoA/b8Y02/hmzF8pYBB0ePAmkmU/ Fgig== X-Gm-Message-State: AO0yUKV5jRTvO4w/fZx4MSk36GyZmLx3zYjKyAsDilC4pToD/ZYSaShN 0M2C+LKrKmi426M1F6BnGHBsj5sB2lyPB6B2Ethw9UKMTqAw0rZG//caKVWBYrgcugKo7k055ry 7mZHxWznTBBySb3FzSgP55S2LCIy5ESYFS2AqcZh+ergzQwpbqgQJZ6eWTWA/oUzUWkuhl4syt5 afeTIhfw== X-Received: by 2002:a1c:7510:0:b0:3ee:1239:1ba7 with SMTP id o16-20020a1c7510000000b003ee12391ba7mr21273075wmc.27.1680294064159; Fri, 31 Mar 2023 13:21:04 -0700 (PDT) X-Google-Smtp-Source: AK7set+j5+dx9xOgLgAgyP+5mTwKx7I0GEIhVmcxuFQTp8qisIb5Bdc1qrZ/RjVfVZ0Vggbl+n1UTQ== X-Received: by 2002:a1c:7510:0:b0:3ee:1239:1ba7 with SMTP id o16-20020a1c7510000000b003ee12391ba7mr21273063wmc.27.1680294063782; Fri, 31 Mar 2023 13:21:03 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id z7-20020a7bc7c7000000b003ed1f111fdesm3733295wmk.20.2023.03.31.13.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 13:21:03 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/5] gdb: remove some trailing newlines from warning messages Date: Fri, 31 Mar 2023 21:20:55 +0100 Message-Id: <665671fabbb2fe3ce05578c0ce26ce7fe3d7f513.1680293848.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.7 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_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: While working on a later patch in this series, which tightens up some of our pattern matching when using gdb_test, I ran into some failures caused by some warnings having a trailing newline character. The warning function already adds a trailing newline, and it is my understanding that we should not be adding a second by including a newline at the end of any warning message. The problem cases I found were in language.c and remote.c, in this patch I fix these cases, and also audited all the warning() calls in these two files and fixed any additional problems I found. In remote.c the warning actually had a newline character in the middle of the warning message (in addition to the trailing newline), which I've removed. I don't think it's helpful to forcibly split a warning as was done here -- in the middle of a sentence. Additionally, the message isn't even that long (71 characters), so I think removing this newline is an improvement. None of the expected test result need updating with this commit, currently the patterns in gdb_test will match one or more newline sequences, so the tests are as happy with one newline (after this commit) as they are with two newlines (before this commit). A later commit will change gdb_test so that it is not so forgiving, and these warnings would have caused some failures. --- gdb/language.c | 8 ++++---- gdb/remote.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/language.c b/gdb/language.c index 50a53c647f5..b7beb112702 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -229,7 +229,7 @@ show_range_command (struct ui_file *file, int from_tty, || ((range_check == range_check_on) != current_language->range_checking_on_by_default ())) warning (_("the current range check setting " - "does not match the language.\n")); + "does not match the language.")); } /* Set command. Change the setting for range checking. */ @@ -266,7 +266,7 @@ set_range_command (const char *ignore, || ((range_check == range_check_on) != current_language->range_checking_on_by_default ())) warning (_("the current range check setting " - "does not match the language.\n")); + "does not match the language.")); } /* Show command. Display a warning if the case sensitivity setting does @@ -303,7 +303,7 @@ show_case_command (struct ui_file *file, int from_tty, if (case_sensitivity != current_language->case_sensitivity ()) warning (_("the current case sensitivity setting does not match " - "the language.\n")); + "the language.")); } /* Set command. Change the setting for case sensitivity. */ @@ -335,7 +335,7 @@ set_case_command (const char *ignore, int from_tty, struct cmd_list_element *c) if (case_sensitivity != current_language->case_sensitivity ()) warning (_("the current case sensitivity setting does not match " - "the language.\n")); + "the language.")); } /* Set the status of range and type checking and case sensitivity based on diff --git a/gdb/remote.c b/gdb/remote.c index 526df313ea7..f436b8714cf 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -11250,8 +11250,8 @@ compare_sections_command (const char *args, int from_tty) } } if (mismatched > 0) - warning (_("One or more sections of the target image does not match\n\ -the loaded file\n")); + warning (_("One or more sections of the target image does " + "not match the loaded file")); if (args && !matched) gdb_printf (_("No loaded section named '%s'.\n"), args); } -- 2.25.4