This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17393] New: "unused variable '._0'" warning with -Wall


Hello,

I found this minor bug that produces a wrong warning message
just recently. The following erroneous source code,
when compiled with -Wall

  struct A { };

  void foo()
  {
      A& = a;
  }

results in this output:

g++ -Wall foo.cc

foo.cc: In function `void foo()':
foo.cc:5: error: abstract declarator `A&' used as declaration
foo.cc:5: error: `a' undeclared (first use this function)
foo.cc:5: error: (Each undeclared identifier is reported only once for each
function it appears in.)
foo.cc:5: warning: unused variable '._0'


Here are the configuration options of the compiler:

Reading specs from
/share/local/lang/gcc341-sol7/bin/../lib/gcc/sparc-sun-solaris2.7/3.4.1/specs
Configured with: ../../gcc-3.4.1/configure --prefix=/opt/local/lang/gcc341-sol7
--enable-shared --enable-cpp --disable-threads --with-gnu-ld
--with-ld=/opt/local/lang/gcc341-sol7/bin/ld --with-gnu-as
--with-as=/opt/local/lang/gcc341-sol7/bin/as --with-cpu=supersparc --disable-nls
--disable-multilib --enable-c99 --enable-concept-checks --with-dwarf2
--enable-languages=c,c++
Thread model: single
gcc version 3.4.1
 

Yours,

Timo Erkkilä

-- 
           Summary: "unused variable '._0'" warning with -Wall
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: timoe at cs dot tut dot fi
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: sparc-sun-solaris2.7


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]