guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some leftover bugs for this release


From: Mike Gran
Subject: Re: Some leftover bugs for this release
Date: Tue, 15 Sep 2009 17:20:42 -0700 (PDT)

> From: Ludovic Courtès <address@hidden>
> 
> Hi,
> 
> Mike Gran writes:
> 
> > Also, the netbsd build will likely fail because there is new
> > 'condition is always true' condition in array-handle.c:103
> >
> > 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?

I poked around the gcc source code to see under what conditions the
"comparison is always true due to limited range of data type" warnings
occur.  These are the ones that NetBSD gcc seems to have and that
my gcc doesn't have.  For them to occur, it seems that the Wtype-limits
warning option must be active on that platform, but, not on mine.

I tried to figure out why this was so by looking at some of the BSD
CVS trees, but, I couldn't find out where this was enabled by default.
I'm not that familiar with the the organization of the BSD sources, though.

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.

[Insert standard rant about using -Werror here.]

Thanks,

Mike




reply via email to

[Prev in Thread] Current Thread [Next in Thread]