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

Bug#615157: gcc-4.6: -Wunused-but-set-variable -Werror does not imply -Werror=unused-but-set-variable



Package: gcc-4.6
Version: 4.6-20110216-1

Hi,

Turning on -Werror so the warnings don't scroll by.

 $ cat test.c
#include <stdio.h>

int main(void)
{
        int x;
        x = printf("hello, world\n");
        return 0;
}
 $
 $ gcc-4.6 -Wall -Werror test.c; echo $?
test.c: In function ‘main’:
test.c:5:6: warning: variable ‘x’ set but not used [-Wunused-but-set-variable]
0
 $ gcc-4.6 -Wunused-but-set-variable -Werror test.c; echo $?
test.c: In function ‘main’:
test.c:5:6: warning: variable ‘x’ set but not used [-Wunused-but-set-variable]
0
 $ gcc-4.6 -Werror=unused-but-set-variable test.c; echo $?
test.c: In function ‘main’:
test.c:5:6: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]
cc1: some warnings being treated as errors

1

I would have expected all three to error out.

Known problem?
Jonathan 



Reply to: