[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hash.c:101: pointers are not permitted as case values
From: |
Marius Vollmer |
Subject: |
Re: hash.c:101: pointers are not permitted as case values |
Date: |
07 Jun 2001 02:56:14 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102 |
[taken to guile-devel]
Dirk Herrmann <address@hidden> writes:
> There's a problem with that fix. You are not supposed to use function
> calls as a case value. The functionality of SCM_UNPACK is quite simple
> with SCM_DEBUG_TYPING_STRICTNESS set to 0 or 1, but it fails, since
> SCM_UNPACK calls a function when SCM_DEBUG_TYPING_STRICTNESS is 2.
Yes, noticed that, but the fix is good enough for now, I'd say. Even
if Guile does not currently compile completely with
SCM_DEBUG_TYPING_STRICTNESS (not because there are type bugs but
because `switch' is limited to constant labels), it is still useful
for detecting type bugs in other places.
> A possible solution is to define a number of alternative macros,
> like for example SCM_EOL_BITS (or SCM_RAW_EOL or SCM_BITS_EOL or
> whatever naming scheme to be used), which represent the integer
> value before packing.
Hmm, just a thought: what about defining our own SCM_SWITCH macro that
gets expanded into a regular switch statement for the normal cases and
into if/else/goto linguini for the hard case. Or maybe we can rely on
the compiler to optimize if/else as well as switch?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: hash.c:101: pointers are not permitted as case values,
Marius Vollmer <=