[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using (SCM)0
From: |
Marius Vollmer |
Subject: |
Re: Using (SCM)0 |
Date: |
Fri, 10 Oct 2003 16:38:56 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
Ludovic Courtès <address@hidden> writes:
> Is there anything wrong with using (SCM)0 as a "special value" in C
> code? In other words, is it possible for a "real" SCM object to be
> equal to zero, in which case I'd better use SCM_UNDEFINED or some such?
Yes. (SCM)0 will be interpreted as a pointer to a cell at address 0,
which will segfault.
You need to be careful with SCM_UNDEFINED as well. I must _never_
reach Scheme code. I.e., you can't put it into pairs, vectors, etc.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
- Using (SCM)0, Ludovic Courtès, 2003/10/10
- Re: Using (SCM)0,
Marius Vollmer <=