This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bugs in numbers.c (with patch)


Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

> On Wed, 22 Mar 2000, Dirk Herrmann wrote:
> 
> > On Wed, 22 Mar 2000, Dale P. Smith wrote:
> > 
> > > SCM is now (void *).  So it is unsigned.  So (x < 0) will *never*
> > > return true.  The compiler will probably just optimize away the tests.
> > > I would think it would be a good idea to go over all the code and
> > > check for places where a raw SCM value is compared < 0.
> > > 
> > > The patch to numbers.h I'm not sure about, but I think it's right.
> > 
> > Thanks for the patches.  I have applied them.
> 
> As we have learned by now, using void* is by far not sufficient to catch
> all misuses of SCM values.  The operators ==, !=, <, <=, >, >=, +, -, ++,
> -- can be performed on pointers.
> 
> Only looking for +, ++, -, --, <, <=, >, >=, !, I compiled guile with SCM
> typedef'd to union { struct { scm_bits_t n; } n; }.  This resulted in the

<snip>

It'd be nice to have an easy #define to use to select your typedef
(strictly for bug-searching, not for generating the real executable --
the void * patch is a good middle ground for that for now).

Thanks,
Greg

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]