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

Ryan McCabe rmccabe at redhat.com
Thu Aug 30 17:53:29 UTC 2007


On Thu, Aug 30, 2007 at 01:38:46PM -0400, Lon Hohberger wrote:
> I agree.  Clean code is a good thing.
> 
> However, others may / may not want to comment.

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

[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

Ryan




More information about the Cluster-devel mailing list