[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some leftover bugs for this release
From: |
Andy Wingo |
Subject: |
Re: Some leftover bugs for this release |
Date: |
Wed, 16 Sep 2009 21:29:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) |
Hi,
On Wed 16 Sep 2009 11:09, address@hidden (Ludovic Courtès) writes:
>>> > 100 SCM
>>> > 101 scm_array_handle_element_type (scm_t_array_handle *h)
>>> > 102 {
>>> > 103
>>> if (h->element_type < 0 || h->element_type > SCM_ARRAY_ELEMENT_TYPE_LAST)
>>> > 104 abort (); /* guile programming error */
>>> > 105 return scm_i_array_element_types[h->element_type];
>>> > 106 }
>>>
>>> Hmm, an enum variable can possibly hold any integer value, so why would
>>> this always be true? Are you actually hitting this?
>
> [...]
>
>> So when I enable -Wtype-limits on my build, it warns for any enum
>> value that is beyond those enumerated in the type definition. The
>> smallest value in this enum is zero, hence the warning.
>
> Then we could just use ‘-Wtype-limits’ and remove the above run-time
> check. Andy?
The struct could get corrupted somehow of course. It's not a bad check,
but the typechecker is working against us :P
Andy
--
http://wingolog.org/