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

Re: [Cluster-devel] [RFC] Switch the entire project to use -Werror



Ryan McCabe wrote:
> On Thu, Aug 30, 2007 at 06:59:22PM +0100, Fabio M. Di Nitto wrote:
>> int x, y=1; <- doesn´t init x to 1. Only y.
>>
>> and you are getting a warning on if(y || x). at this point only y is
>> initialized. So for what I can see it is valid.
>>
>> and please flame hard if i am missing the point... i just come out of an
>> 11 hours meeting ;)
> 
> x is never evaluated because the || short-circuits once y evaluates to
> true, so x is never read before being initialized. This is kind of a
> contrived example, but I've seen GCC report these same kinds of bogus
> errors in code that isn't contrived.
> 
> Ryan

Oh ok.. of course you are right and I see the point.

Thanks
Fabio

-- 
I'm going to make him an offer he can't refuse.


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