guile-devel
[Top][All Lists]
Advanced

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

Re: SCM_PTR_LE ?


From: Lynn Winebarger
Subject: Re: SCM_PTR_LE ?
Date: Thu, 1 Aug 2002 12:15:10 -0500

On Thursday 01 August 2002 11:40, Marius Vollmer wrote:
> same array or a single block returned from malloc.  A consequence
> would be that you can not reliably test whether a pointer does point
> into some object, since the results are not defined when it points
> outside.  For example, is the following guaranteed to print "sane"?
> 
>     char block1[100];
>     char block2[100];
> 
>     char *ptr = block1 + 50;
> 
>     if (ptr >= block2 && ptr < block2+100)
>       printf ("sane\n");
>     else
>       printf ("insane\n");
> 
> I don't know.    
    That would be not, as it prints insane on my athlon-based
linux system.  Now if you tried block2 + 150, or block1 - 50,
we might have an interesting question.

Lynn



reply via email to

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