This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ bug when using extern "C"
- To: gcc-bugs at gcc dot gnu dot org
- Subject: C++ bug when using extern "C"
- From: Dirk De Rycke <dirk dot de dot rycke at chello dot be>
- Date: Fri, 13 Jul 2001 23:01:16 +0200
Hi,
Today I may have hit a bug in g++.
Try compiling the following program with g++ -c
extern "C" {
void xxx(void (*f)());
void yyy(void (*f)(void));
}
void xxx(void (*f)())
{
}
void yyy(void (*f)(void))
{
}
After compiling examine the object file with nm -s you get the following
symbols
[dirk@hades dirk]$ nm -s cppbug.o
00000000 ? __FRAME_BEGIN__
00000000 t gcc2_compiled.
00000000 T xxx__FPFv_v
0000000c T yyy
So the first function still has C++ name mangling and seems to ignore
the extern "C",
adding the void to the second function solves the problem. Is this a
bug or a known feature
for some strange reason? If it is a bug can somebody try it on the GCC
3.0?
My compiler version is
Reading specs from /usr/lib/gcc-lib/i586-pld-linux/2.95.3/specs
gcc version 2.95.3 20010315 (release)
regards,
Dirk De Rycke