From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Lisp object that refers to a C struct Date: Thu, 18 Oct 2012 00:20:11 -0700 Organization: UCLA Computer Science Department Message-ID: <507FADAB.5060108@cs.ucla.edu> References: <83ehkz4edw.fsf@gnu.org> <83bog33wdr.fsf@gnu.org> <837gqq49j7.fsf@gnu.org> <83r4ox3frd.fsf@gnu.org> <83ipa92i95.fsf@gnu.org> <83bog03jyf.fsf@gnu.org> <507F2C74.4070107@cs.ucla.edu> <83391c2xjq.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1350544829 27658 80.91.229.3 (18 Oct 2012 07:20:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Oct 2012 07:20:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 18 09:20:34 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TOkPC-0005GK-Je for ged-emacs-devel@m.gmane.org; Thu, 18 Oct 2012 09:20:34 +0200 Original-Received: from localhost ([::1]:34804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOkP5-0008UN-AO for ged-emacs-devel@m.gmane.org; Thu, 18 Oct 2012 03:20:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOkP2-0008Ti-Jx for emacs-devel@gnu.org; Thu, 18 Oct 2012 03:20:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOkOw-0006F7-UQ for emacs-devel@gnu.org; Thu, 18 Oct 2012 03:20:24 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:55105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOkOq-0006EM-9X; Thu, 18 Oct 2012 03:20:12 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 86065A6000B; Thu, 18 Oct 2012 00:20:11 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bYHhC21OGX1I; Thu, 18 Oct 2012 00:20:11 -0700 (PDT) Original-Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 27796A60007; Thu, 18 Oct 2012 00:20:11 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 In-Reply-To: <83391c2xjq.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154403 Archived-At: On 10/17/2012 09:50 PM, Eli Zaretskii wrote: >> Won't this have problems on platforms where >> > (EMACS_INT) pwatch < MOST_NEGATIVE_FIXNUM, >> > or where MOST_POSITIVE_FIXNUM < (EMACS_INT) pwatch? > Given what XLI does, I don't see how this could happen To be honest I haven't followed all the back-and-forth on this, but in general it's not safe to convert a pointer to an Emacs fixnum, as this can lose information: the payload of an Emacs fixnum is typically narrower than a pointer.