[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



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 sublimit ~]$ cat test.c
int main(void) {
    int x, y = 1;
    if (y || x)
        x = 1;
    return 0;
}

[rmccabe 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


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