This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc-2.9[67]: C++: extern "C" functions with empty argument-lists refuse to accept arguments.
- To: gcc-bugs at gcc dot gnu dot org
- Subject: gcc-2.9[67]: C++: extern "C" functions with empty argument-lists refuse to accept arguments.
- From: peter miller <fuchsia dot groan at virgin dot net>
- Date: Fri, 17 Nov 2000 20:30:57 +0000 (GMT)
- Reply-to: fuchsia dot groan at virgin dot net
/*
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
----------------------------------------------------------------------------
*/