From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: pdumper on Solaris 10 Date: Tue, 17 Dec 2024 11:10:45 -0800 Organization: UCLA Computer Science Department Message-ID: <89cba675-90e6-49d1-b774-f0498de6ac19@cs.ucla.edu> References: <8634iwex8q.fsf@gnu.org> <86wmg7bso1.fsf@gnu.org> <865xnrbh3r.fsf@gnu.org> <87bjxil35f.fsf@protonmail.com> <86seqqtjzb.fsf@gnu.org> <87o71ddxmf.fsf@protonmail.com> <86a5cxryfp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38722"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii , Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 17 20:11:52 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tNcz1-0009uI-Mc for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Dec 2024 20:11:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNcy6-0007kE-Oj; Tue, 17 Dec 2024 14:10:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNcy3-0007k0-Id for emacs-devel@gnu.org; Tue, 17 Dec 2024 14:10:51 -0500 Original-Received: from mail.cs.ucla.edu ([131.179.128.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNcy1-0005T7-2u; Tue, 17 Dec 2024 14:10:51 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id CC1E43C00FB31; Tue, 17 Dec 2024 11:10:45 -0800 (PST) Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id ZO32gcRPX8g3; Tue, 17 Dec 2024 11:10:45 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 832F93C00FA8F; Tue, 17 Dec 2024 11:10:45 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 832F93C00FA8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1734462645; bh=/S9FASeM8Va3eiVkmIzwPJNnLYMSPqrC3ObE2Qs4O/s=; h=Message-ID:Date:MIME-Version:To:From; b=QIhHGHWE8KimFVozTaAl/sMV/Nna+36QTGsOqtWzOb5ueTRt06O2ElCLgWWxD+fjD zMOAR82ISzZdVmrxRr+pm7RGLCE+1MEyNT4diDhtwENcrjFxKc+fws/QOicCJTyxCE 9g5bTFJ1kKKyNZTnLxHWh5NmLNIe4W3X75XWVMrpSZMh7XA4IjZI4WXiFuE2Z1K8fc cm79CNIsanEULdgLUsNpMnYUyBDr6mnLRo+0El02W0nwFMe3SyYnWA5va5PfxwDr4v bkfGnAJIkWn3sZUZPzEUy8KyQgYPsyfRkf2EIzg8jy+K/KEMv6VEyuEDO//z7M4GwS 9wt1xzu3oUprg== X-Virus-Scanned: amavis at mail.cs.ucla.edu Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id IDlNLWtIJlO1; Tue, 17 Dec 2024 11:10:45 -0800 (PST) Original-Received: from [192.168.254.12] (unknown [47.154.27.134]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 5E9D83C00FB31; Tue, 17 Dec 2024 11:10:45 -0800 (PST) Content-Language: en-US In-Reply-To: <86a5cxryfp.fsf@gnu.org> Received-SPF: pass client-ip=131.179.128.66; envelope-from=eggert@cs.ucla.edu; helo=mail.cs.ucla.edu X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326611 Archived-At: On 2024-12-15 03:13, Eli Zaretskii wrote: >> Date: Sun, 15 Dec 2024 10:55:49 +0000 >> From: Pip Cet >> >> "Eli Zaretskii" writes: >> >>> CC igc.o >>> igc.c: In function 'weak_hash_table_entry': >>> igc.c:4102:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] >>> 4102 | client = (mps_addr_t)entry.intptr; >>> | ^ >>> igc.c:4107:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] >>> 4107 | client = (mps_addr_t)real_ptr; >>> | ^ ... >> What's the preferred way of avoiding a compiler warning in this case? >> A simple double cast (first to uintptr_t, then to mps_addr_t) should >> work, right? > I'll defer to Paul (CC'ed), but my personal preference is also to > explicitly reset the ignored bits by bitwise AND. The usual way I avoid such warnings is a single cast of the pointer to uintptr_t (or to intptr_t, if the eventual destination is signed). There is no need for two casts, or for a bitwise AND, and I usually avoid these needless operations as they can be more trouble than they're worth: they introduce more hassle for maintainers and more possibilities for bugs.