emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp object that refers to a C struct


From: Paul Eggert
Subject: Re: Lisp object that refers to a C struct
Date: Wed, 17 Oct 2012 15:08:52 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121009 Thunderbird/16.0

On 10/17/2012 01:46 PM, Eli Zaretskii wrote:
>> How do you convert the integer into the C struct pointer?
>   struct foo *pwatch = (struct foo *)XLI (watch_descriptor);
> 
> where watch_descriptor is a Lisp integer.

Won't this have problems on platforms where
(EMACS_INT) pwatch < MOST_NEGATIVE_FIXNUM,
or where MOST_POSITIVE_FIXNUM < (EMACS_INT) pwatch?

Also, suppose someone makes up a random integer
and then passes it as the watch descriptor --
wouldn't Emacs dump core?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]