From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 10ED13858D35 for ; Tue, 14 Feb 2023 19:29:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10ED13858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.192] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BBE311E110; Tue, 14 Feb 2023 14:29:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1676402957; bh=GsfANpx3SNjcJtMB5sEIPnJLlMrQLQTMTRj3UrDcP5k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=s4ZCLyrXiObsZuGY5jt8lNCgFNl3zrUt4uBFobsqWprNnPbP565JGwTjnYG+cWu9w do4aYM2yYfTppUryOgbyhqeHK3Zxa6BRgNk8decTW2tBwUDazomFpp9gR8M9QwxHQN AuCScuH97jTeTko4ZmrWwwemoikfSJnpB3HT+m7Y= Message-ID: <93c37005-30ec-f211-9e06-3a4896e134b2@simark.ca> Date: Tue, 14 Feb 2023 14:29:16 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH] gdb: cast return value of std::unique_ptr::release to void Content-Language: fr To: Tom Tromey , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20230213195513.37532-1-simon.marchi@efficios.com> <87pmadcde1.fsf@tromey.com> From: Simon Marchi In-Reply-To: <87pmadcde1.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,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: > Normally I think we should work to get rid of .release() calls. > However this one looks like a pain, probably why it is already there. > And, your patch doesn't make anything worse in this regard. So as much > as I hate cast to void I think it's ok. Same feeling here. It's not pretty, but the (void) doesn't change anything in what we're doing. I wanted to change cmd_list_element in the past to have "doc_holder" and "name_holder" fields, both of which would be gdb::unique_xmalloc_ptr. They would be set if the cmd_list_element owns the memory for doc and name, and would make the management automatic. But I'm afraid that people will say "but it makes cmd_list_element larger for nothing", so I never sent it. But if you think it's worth it, I can do that. > Approved-By: Tom Tromey Thanks, will push. Simon