From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Lisp object that refers to a C struct Date: Thu, 18 Oct 2012 13:09:50 +0200 Message-ID: <83y5j411fl.fsf@gnu.org> 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> <507FADAB.5060108@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1350558601 15251 80.91.229.3 (18 Oct 2012 11:10:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Oct 2012 11:10:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 18 13:10:08 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 1TOnzG-0005xH-OO for ged-emacs-devel@m.gmane.org; Thu, 18 Oct 2012 13:10:02 +0200 Original-Received: from localhost ([::1]:35492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOnz9-0003dU-Kk for ged-emacs-devel@m.gmane.org; Thu, 18 Oct 2012 07:09:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOnz7-0003dC-9q for emacs-devel@gnu.org; Thu, 18 Oct 2012 07:09:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOnz2-0007UA-JR for emacs-devel@gnu.org; Thu, 18 Oct 2012 07:09:53 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:44067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOnz2-0007Tp-B9 for emacs-devel@gnu.org; Thu, 18 Oct 2012 07:09:48 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MC300C005NOUR00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Thu, 18 Oct 2012 13:09:35 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MC300C0D5NYHY90@a-mtaout23.012.net.il>; Thu, 18 Oct 2012 13:09:34 +0200 (IST) In-reply-to: <507FADAB.5060108@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.175 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:154408 Archived-At: > Date: Thu, 18 Oct 2012 00:20:11 -0700 > From: Paul Eggert > CC: emacs-devel@gnu.org > > 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. A pointer that is properly aligned has no problem with this. After all, that's how we produce every Lisp object out of a pointer.