cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Fabio M. Di Nitto <fabbione@ubuntu.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [RFC] Switch the entire project to use -Werror
Date: Thu, 30 Aug 2007 18:59:22 +0100	[thread overview]
Message-ID: <46D7057A.8030403@ubuntu.com> (raw)
In-Reply-To: <20070830175329.GA156481@redhat.com>

Ryan McCabe wrote:

> 
> GCC can still be really stupid and issue warnings about code that's
> perfectly fine, for example:

Right.. but it is "usually" right.

> 
> [rmccabe at sublimit ~]$ cat test.c
> int main(void) {
>     int x, y = 1;
>     if (y || x)
>         x = 1;
>     return 0;
> }
> 
> [rmccabe at sublimit ~]$ gcc -O2 -Wall -Werror test.c -o test
> cc1: warnings being treated as errors
> test.c: In function ?main?:
> test.c:3: warning: ?x? is used uninitialized in this function
> 

This gcc catch looks good to me.

int x, y=1; <- doesn?t init x to 1. Only y.

and you are getting a warning on if(y || x).@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 ;)

Fabio

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



  reply	other threads:[~2007-08-30 17:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-26  5:56 [Cluster-devel] [RFC] Switch the entire project to use -Werror Fabio Massimo Di Nitto
2007-08-29  3:13 ` Fabio Massimo Di Nitto
2007-08-30 17:38 ` Lon Hohberger
2007-08-30 17:53   ` Ryan McCabe
2007-08-30 17:59     ` Fabio M. Di Nitto [this message]
     [not found]       ` <20070830180912.GB156481@redhat.com>
2007-08-30 18:12         ` Fabio M. Di Nitto
2007-08-30 17:54   ` Fabio M. Di Nitto
2007-08-31 12:02   ` Patrick Caulfield
2007-08-31 12:19     ` Fabio M. Di Nitto
2007-09-07 18:28       ` Lon Hohberger
2007-09-07 18:26     ` Lon Hohberger

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46D7057A.8030403@ubuntu.com \
    --to=fabbione@ubuntu.com \
    /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 NNTP newsgroup(s).