[Bug c++/28156] New: spurious warning: function defined but not used
rwxr-xr-x at gmx dot de
gcc-bugzilla@gcc.gnu.org
Sat Jun 24 20:52:00 GMT 2006
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
More information about the Gcc-bugs
mailing list