From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id R9J8DWHbNWPwEwIAWB0awg (envelope-from ) for ; Thu, 29 Sep 2022 13:52:33 -0400 Received: by simark.ca (Postfix, from userid 112) id 2A8BA1E112; Thu, 29 Sep 2022 13:52:33 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=A28cOxDK; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 simark.ca (Postfix) with ESMTPS id CF4961E0D5 for ; Thu, 29 Sep 2022 13:52:32 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CBB54385414F for ; Thu, 29 Sep 2022 17:52:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBB54385414F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664473951; bh=o2FCf7bk4ZAIpMd28vq7PXlPtOy9nQPME7UBeUdHXmo=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=A28cOxDKPhdr7u1vIQbkKPOkuaM1NbIMaa8x+R04dQ0CuagugRUA7EztmElzV/Vga U8TnyCxV4ku6z1n+ROamd3tpsc+G1IW1AEiDx3hKRHhgtrMCGmtdSp6tU6ahqQmB9e xTtbYT4PlOHbWalXGfriMXwrZSNO0WPCQwZqHBIQ= 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 C793C385416E for ; Thu, 29 Sep 2022 17:52:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C793C385416E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-167-xk0Hqgd8NwWa-lSsL4pr5w-1; Thu, 29 Sep 2022 13:52:07 -0400 X-MC-Unique: xk0Hqgd8NwWa-lSsL4pr5w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63BFD86E926; Thu, 29 Sep 2022 17:52:07 +0000 (UTC) Received: from [10.2.17.232] (unknown [10.2.17.232]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2048E140EBF3; Thu, 29 Sep 2022 17:52:07 +0000 (UTC) Message-ID: <9992b2dc-60f4-539a-1727-1dc9546b2bc2@redhat.com> Date: Thu, 29 Sep 2022 10:52:06 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH][gdb/c++] Print destructor the same for gcc and clang To: Tom de Vries , gdb-patches@sourceware.org References: <20220927103546.GA27362@delia.home> In-Reply-To: <20220927103546.GA27362@delia.home> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Keith Seitz via Gdb-patches Reply-To: Keith Seitz Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 9/27/22 03:35, Tom de Vries wrote: > > Fix this by rewriting the code to: > - always enter the loop > - handle whether arguments need printing in the loop > - keep track of how many arguments are printed, and > use that after the loop to print void etc. > such that we have the same for both gcc and clang: > ... > A(void); > ~A(void); > ... > > Note that I consider the discussion of whether we want to print: > - A(void) / ~A(void), or > - A() / ~A() > out-of-scope for this patch. > > Tested on x86_64-linux. > > Any comments? This all looks okay; thank you for that cleanup. Consistency is welcome. On the [off-]topic of "void" vs ""... The standard (IIUC) permits the use of "void" in destructors. If I create a class with a private dtor, e.g., to elicit a compilation failure, clang++ never outputs the symbol name. GCC, on the other hand, does, and it outputs "" (no "void", even if I explicitly use "void" in the dtor). While I would prefer "", I don't have a compelling argument either way. [It's trivial to implement with your patch.] I recommend you approve your patch. :-) Keith