From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 5D27D3858D33 for ; Wed, 17 Jan 2024 19:25:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D27D3858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5D27D3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705519544; cv=none; b=mKpeeGv322c07QpE6ll9WM7tYCwR5KGUY4GKET7aPLXeBWTIgRmPhe6RGerU09YcnQOe7Ew2k5md/5by+C1i7n4UNJKfYd36XPOZBIrnKzYJCUOa/zOv4CCCGPaMZGhNKSsaPnqVj20Vi32q0VyJVHD3qftM3+/rhv/sEmldhi8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705519544; c=relaxed/simple; bh=BMARGZbT/++WK9hAKPyQMvvM5vjvfCGHoJhDMoWNHik=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Vv5sUI6FJC+wPcTNREtelhllXAu9uwhXjM3ycQD97Mxf2nuD5hylG8tHuIWFheYPFL76chJjNU749/jQMXPlTY7ner6w8BZL+SIW+c6w1ojKl4lUZ6gm1t2UimhmLMTRo6ZJFbytZI2Wr5GCOo0LV+o6AxDTdTBhc/Pq/jNG9G0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5009a.ext.cloudfilter.net ([10.0.29.176]) by cmsmtp with ESMTPS id QB8urafL2oMN9QBXhrD1go; Wed, 17 Jan 2024 19:25:41 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id QBXgraP4xV9xYQBXgroqpr; Wed, 17 Jan 2024 19:25:40 +0000 X-Authority-Analysis: v=2.4 cv=NfP1akP4 c=1 sm=1 tr=0 ts=65a829b4 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=VnNF1IyMAAAA:8 a=W8C1m6eP0hxVH8yU3ZUA:9 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=6bVbY8RX36hAqRkRnCZpm1aBxISvrb0jlVX0vXBnKiY=; b=bTKb7bfvsqeUJCq0FQhq0aozSv xEFCS3ZD4ypePiZ5teUjkMh2gg367FfYDpx5xTMMU6tnAR5quAkKHreDEvr4Hn6deSXLo0XiLSUEv 00g2owoSt0oMn314fe0WxDsQS; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:41068 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rQBXf-000EGk-2Z; Wed, 17 Jan 2024 12:25:39 -0700 From: Tom Tromey To: Aditya Vidyadhar Kamath Cc: tom@tromey.com, gdb-patches@sourceware.org Subject: Re: [PATCH] Fix AIX build break. References: <20240117182831.74066-1-Aditya.Kamath1@ibm.com> X-Attribution: Tom Date: Wed, 17 Jan 2024 12:25:38 -0700 In-Reply-To: <20240117182831.74066-1-Aditya.Kamath1@ibm.com> (Aditya Vidyadhar Kamath's message of "Wed, 17 Jan 2024 23:58:31 +0530") Message-ID: <87o7djn4nh.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.68.157 X-Source-L: No X-Exim-ID: 1rQBXf-000EGk-2Z X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net (murgatroyd) [97.122.68.157]:41068 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfEuIm6F3yL/3QsvV8KlvWOaXyH23ptySq7BpnDIIQEnxYMlsFrJGdcPjl0hryI0LXUcT9Chx040GXQM+sSEohYN4X6AmJJKVHn2hkoaoB8vaXy/of6Pb M7QjPkHdFQwZhid/fbA0Hebi3bJ7D5WpjuyJcCTyLAz729fNlF4s5WwyLh7pljp7gFLUbIt/wHtdgG5+nSdgj1b4m23gPQJBZH0= X-Spam-Status: No, score=-3016.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> Aditya Vidyadhar Kamath writes: Thanks for the patch. > +/* local deprecated warning hook. */ > + > +void (*local_warning_hook) (const char *, va_list); I don't understand what this is for. > @@ -56,7 +64,6 @@ complaint_internal (const char *fmt, ...) > } > va_start (args, fmt); > - > if (deprecated_warning_hook) > (*deprecated_warning_hook) (fmt, args); > else Spurious change. > +static thread_local void (*deprecated_warning_hook) (const char *, va_list) = nullptr; Putting this in the header is wrong. This means that there will be multiple instances of this variable. > +typedef void (*deprecated_warning_hook_handler) (const char *, va_list) ATTRIBUTE_FPTR_PRINTF(1,0); Should probably remove the equivalent typedef from complaints.h. It seems to me that we're using this hook more now, so removing the 'deprecated' prefix seems appropriate. That will mess with Insight but this patch is already going to require them to change. > + > +class deprecated_warning_hook_class > +{ > + public: > + deprecated_warning_hook_class (deprecated_warning_hook_handler new_handler); Single-arg constructors should ordinarily be 'explicit'. complaints.h should instantiate the new class in complaint_interceptor. The approach in this patch won't really work, I think. The idea is that the hook should be temporarily (i.e., scoped) set in worker threads. The clear_interpreter_hooks hunk changes the semantics, though I'm not really sure that the current code is correct either. It seems bizarre to me. I'm curious to know why complaint_interceptor::g_complaint_interceptor doesn't cause this same problem. It seems the same to me. Is it because it isn't referenced anywhere other than complaints.c? Tom