From: Andy Wingo <wingo@pobox.com>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: Some leftover bugs for this release
Date: Wed, 16 Sep 2009 21:29:31 +0200 [thread overview]
Message-ID: <m3my4ubsdg.fsf@pobox.com> (raw)
In-Reply-To: <873a6ngsst.fsf@gnu.org> ("Ludovic Courtès"'s message of "Wed, 16 Sep 2009 11:09:06 +0200")
Hi,
On Wed 16 Sep 2009 11:09, ludo@gnu.org (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/
next prev parent reply other threads:[~2009-09-16 19:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-09 18:17 Some leftover bugs for this release Mike Gran
2009-09-15 21:43 ` Ludovic Courtès
2009-09-16 0:20 ` Mike Gran
2009-09-16 9:09 ` Ludovic Courtès
2009-09-16 19:29 ` Andy Wingo [this message]
2009-09-16 19:28 ` Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3my4ubsdg.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).