gcc-2.9[67]: C++: extern "C" functions with empty argument-lists refuse to accept arguments.
peter miller
fuchsia.groan@virgin.net
Fri Nov 17 12:30:00 GMT 2000
/*
gcc version 2.97 20001115 (experimental)
(via http://www.codesourcery.com/gcc-compile.shtml )
fails to compile the following legal (AFAIK) C++
*/
extern "C" {
void func(); // <- g++ seems to think this is 'void func(void);'
};
int main() {
func(0);
}
/*
complaining:
/tmp/@5444.7.cc: In function int main()':
/tmp/@5444.7.cc:2: too many arguments to function void func()'
Which means you can't include tcpd.h from C++.
This was brought to my attention through gcc-2.96 in RedHat 7.0 (I have
moaned at RedHat ;) and I just want to make sure you are aware of it so it
doens't live into gcc 3.0
--
p e t e r m i l l e r * f u c h s i a . g r o a n @ v i r g i n . n e t
----------------------------------------------------------------------------
*/
More information about the Gcc-bugs
mailing list