This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ 2.95.2 considers extern "C" void (*)() and extern "C" void (*)(void) different
- To: gcc bug reports <gcc-bugs at gcc dot gnu dot org>
- Subject: g++ 2.95.2 considers extern "C" void (*)() and extern "C" void (*)(void) different
- From: Martin Sebor <sebor at roguewave dot com>
- Date: Thu, 14 Sep 2000 14:06:48 -0600
- CC: Kevin Djang <djang at roguewave dot com>
- Organization: Rogue Wave Software, Inc.
Hi,
the test case below fails to compile with g++ 2.95.2. 8.3.5, p2: "...
The parameter list (void) is equivalent to the empty parameter list..."
This is causing failures on HP-UX 11.00 (yes, I know, an unsupported
platform) in <unistd.h> and <pthread.h> where pthread_atfork() is
redeclared in a similar manner.
It compiles successfully with -pedantic.
Thanks
Martin
$ cat test.cpp
extern "C" {
void foo (void (*)());
void foo (void (*)(void));
}
$ g++ test.cpp
test.cpp:5: declaration of C function `void foo(void (*)())' conflicts
with
test.cpp:4: previous declaration `void foo(void (*)(...))' here