From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yYRwM3cCNWa+kAQAWB0awg (envelope-from ) for ; Fri, 03 May 2024 11:27:51 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=SlrbTHw8; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C3CB31E0C1; Fri, 3 May 2024 11:27:51 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A69C01E092 for ; Fri, 3 May 2024 11:27:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EF5163844758 for ; Fri, 3 May 2024 15:27:48 +0000 (GMT) Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 9D48338460BD for ; Fri, 3 May 2024 15:27:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D48338460BD 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 9D48338460BD Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714750051; cv=none; b=BYySBPF8XN44a2cBVthpBgXCQfuLsI0fSNVY45ZXLc/g5xyAeDy6fydx3rsXhnxShKIg0D7cjaaE64mbGUZElNXHVyo7OJfeqEXeE4UuatBZQ940FS4vnFdHINSC2i7Niddhi6Wjw7utzC/KrZYhfiNeNLtJVPcjsyZddZj/Jl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714750051; c=relaxed/simple; bh=REVWeeAiycAEtaXgC3BpEseWlvf1JZ0a5NNDEoP6Ias=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CTE5ixM4N+hLzA3hNbj/omE+oBcN2LxdWxnjNlLKPHmtSilX5sVFLVnv2gK6GVtGVH+Ywxk7qcJnhr3owFa893l/8Lhuqopt8r5Wohfhv6lKmLBamNmG7AmLzE9RLsTPxGKGVIn403Sx3Axh1B8IW0jaSBkMiaydI0YuMG8i88c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5006a.ext.cloudfilter.net ([10.0.29.179]) by cmsmtp with ESMTPS id 2Zcts9YtwJXoq2uomsaGk7; Fri, 03 May 2024 15:27:24 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 2uolsZDhq0tBS2uoms4yiy; Fri, 03 May 2024 15:27:24 +0000 X-Authority-Analysis: v=2.4 cv=A5hqPbWG c=1 sm=1 tr=0 ts=6635025c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=TpHVaj0NuXgA:10 a=Qbun_eYptAEA:10 a=20KFwNOVAAAA:8 a=B--gzKEt6iKDQCPL7gAA: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:Date:References:In-Reply-To :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=uCLanxAE3v0e0Rx4VvnDYpt+hQXSf3Th11GzWx+oMK8=; b=SlrbTHw8x9MH85xdbhJnVmt2b2 9zEAGuRlobxXkviocGStcrW3GOCN4JS4XgmBlJ98sEo/895B708TP/JRkLCh3BJoTp5kkR2wxBcpn OPRGJIiP28tAMW/rYpE0PCedB; Received: from 97-122-86-252.hlrn.qwest.net ([97.122.86.252]:37700 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 1s2uol-000ecc-1t; Fri, 03 May 2024 09:27:23 -0600 From: Tom Tromey To: Kevin Buettner Cc: Tom de Vries , gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/exp] Fix cast handling for indirection In-Reply-To: <20240502193145.5da7327d@f39-zbm-amd> (Kevin Buettner's message of "Thu, 2 May 2024 19:31:45 -0700") References: <20240502154902.22575-1-tdevries@suse.de> <20240502193145.5da7327d@f39-zbm-amd> X-Attribution: Tom Date: Fri, 03 May 2024 09:27:22 -0600 Message-ID: <8734qyex0l.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) 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.86.252 X-Source-L: No X-Exim-ID: 1s2uol-000ecc-1t X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-86-252.hlrn.qwest.net (murgatroyd) [97.122.86.252]:37700 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfGqqIQD96gQ/2JeRTYhNHivDcgOz9rTjFgsD6KKsaj9Xt8l4El8RcMCdsvQaPzYi6a7fEJqgBqH8cJc7/6wUxGjU0dmMIsE+teTgd3Da1xAFbyxftRGQ QcNfTWj57KeAJ/5lnBK2NRq4MapmSTIvqeuCDQUegt/cZOFuy7BdUmvcCuKW/Jq8xhFweYYICSGUBZJmxmDAauWhr4G1e13Z7Fc= X-Spam-Status: No, score=-3015.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org >>>>> "Kevin" == Kevin Buettner writes: >> char * >> a_loc (void) Kevin> This surprised me. I would have thought that the evaluation would Kevin> have been: Kevin> (char)*(int)a_loc () Kevin> ...due to the fact that functions lacking an explicit return type Kevin> return 'int' in traditional C. Here the function actually returns char*, it's just the debug info is missing. Normally users should have written: print *(char *) a_loc() here, at least after the changes a while ago to require a cast of the return type here. Longer ago, debuginfo-less functions did default to int return in gdb, but Pedro (I think) changed this a while back. I was wondering if this patch causes gdb to accept some weird things that might have been rejected in the past, by introducing a hidden cast. Maybe print (char) *85732 does something surprising now. I'm not entirely sure if that's bad. Tom