From patchwork Thu Aug 9 18:42:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 28818 Received: (qmail 52236 invoked by alias); 9 Aug 2018 18:42:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 52218 invoked by uid 89); 9 Aug 2018 18:42:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2226, spots X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.49.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Aug 2018 18:42:38 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway23.websitewelcome.com (Postfix) with ESMTP id A61CAB6CB for ; Thu, 9 Aug 2018 13:42:37 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id nptCfAcgrbXuJnptIfZMr2; Thu, 09 Aug 2018 13:42:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kmBbf+BpF49PqQTQkhXgVh/QxHhh/hrlUwyxI7YA8DM=; b=x+75Jvl1dL4o68DW5rPzgmmV0h BgPqDNzf5DWsEvUv4pbxSDsxN3F4+biWTvnyU0Ez6mt5yPWOB3fiVh/h28JpUgw9+4+cy1sBCaU2Q UfNP6rZZFIdm5nxNU81Lgf+N8; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:37856 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fnptB-002GXE-P0; Thu, 09 Aug 2018 13:42:26 -0500 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 1/7] Change completion_tracker to use char type References: <20180808232016.12777-1-tom@tromey.com> <20180808232016.12777-2-tom@tromey.com> Date: Thu, 09 Aug 2018 12:42:22 -0600 In-Reply-To: (Pedro Alves's message of "Thu, 9 Aug 2018 18:38:39 +0100") Message-ID: <87d0uridpt.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 >>>>> "Pedro" == Pedro Alves writes: Pedro> See comment about use of int vs char here: Pedro> https://sourceware.org/ml/gdb-patches/2017-07/msg00228.html Pedro> Look for "Why int". Thanks. How about just this patch, that adds a couple of casts at the necessary spots? Tom commit 5683b8e5ff3dabcea180e0ce84c236189f047cb0 Author: Tom Tromey Date: Thu Aug 9 12:38:39 2018 -0600 Avoid -Wnarrowing warnings from quote_char() This adds a couple of casts to avoid -Wnarrowing warnings coming from the use of quote_char(). 2018-08-09 Tom Tromey * linespec.c (complete_linespec_component): Add cast to "char". * completer.c (completion_tracker::build_completion_result): Add cast to "char". diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b405915c43..2a284fbc10 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2018-08-09 Tom Tromey + * linespec.c (complete_linespec_component): Add cast to "char". + * completer.c (completion_tracker::build_completion_result): Add + cast to "char". + +2018-08-09 Tom Tromey + * riscv-tdep.h: Minor formatting fixes. 2018-08-09 Simon Marchi diff --git a/gdb/completer.c b/gdb/completer.c index 3e87ed454c..1c285262de 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -2032,7 +2032,7 @@ completion_tracker::build_completion_result (const char *text, /* We don't rely on readline appending the quote char as delimiter as then readline wouldn't append the ' ' after the completion. */ - char buf[2] = { quote_char () }; + char buf[2] = { (char) quote_char () }; match_list[0] = reconcat (match_list[0], match_list[0], buf, (char *) NULL); diff --git a/gdb/linespec.c b/gdb/linespec.c index 790ddf4740..dcaaaefaaa 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -2894,7 +2894,7 @@ complete_linespec_component (linespec_parser *parser, new "quote" char. */ if (tracker.quote_char ()) { - char quote_char_str[2] = { tracker.quote_char () }; + char quote_char_str[2] = { (char) tracker.quote_char () }; fn = reconcat (fn, fn, quote_char_str, (char *) NULL); tracker.set_quote_char (':');