[Bug c/17820] New: Two kinds of unused warnings

jakub at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Oct 3 22:56:00 GMT 2004


static int a = 10;
static int b = 20;
static int c = 30;

gcc -Wall test.c
./xgcc -B ./ -Wall test.c -S
test.c:3: warning: unused variable 'c'
test.c:2: warning: unused variable 'b'
test.c:1: warning: unused variable 'a'
test.c:1: warning: 'a' defined but not used
test.c:2: warning: 'b' defined but not used
test.c:3: warning: 'c' defined but not used

With -xc++ it emits only the latter 3 warnings, likewise with gcc 3.4.x.

-- 
           Summary: Two kinds of unused warnings
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17820



More information about the Gcc-bugs mailing list