This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28156] New: spurious warning: function defined but not used
- From: "rwxr-xr-x at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2006 20:33:51 -0000
- Subject: [Bug c++/28156] New: spurious warning: function defined but not used
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi,
$ cat try.cc
#include <iostream>
static void foo() {
std::cout << "hello, world\n";
}
int main() {
extern void foo();
foo();
}
$ g++-4.1.0 -Wall try.cc
try.cc:3: warning: `void foo()' defined but not used
$ ./a.out
hello, world
foo() is clearly used there so why does g++ warn about it?
--
Summary: spurious warning: function defined but not used
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rwxr-xr-x at gmx dot de
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28156