From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio M. Di Nitto Date: Thu, 30 Aug 2007 19:12:41 +0100 Subject: [Cluster-devel] [RFC] Switch the entire project to use -Werror In-Reply-To: <20070830180912.GB156481@redhat.com> References: <46D11608.5060501@ubuntu.com> <20070830173846.GW17551@redhat.com> <20070830175329.GA156481@redhat.com> <46D7057A.8030403@ubuntu.com> <20070830180912.GB156481@redhat.com> Message-ID: <46D70899.90902@ubuntu.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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.