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]

g++ 2.95.2 considers extern "C" void (*)() and extern "C" void (*)(void) different


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

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