This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
File "test.cc" demonstrating a bug in gcc 2.95 on SCO 5.0.5a
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: File "test.cc" demonstrating a bug in gcc 2.95 on SCO 5.0.5a
- From: "Yeracaris, Anthony" <Anthony dot Yeracaris at tfn dot com>
- Date: Thu, 6 Jan 2000 15:53:39 -0500
/*
* This program demonstrates a bug in the following version of gcc
* (gcc -v):
* gcc version 2.95 19990728 (release)
* This version was built on and run from the following machine
* (uname -a):
* SCO_SV kelp 3.2 5.0.5 i386
* No options were passed to configure.
* No modifications were made to the compiler source.
*
* The compiler complains with the following error:
* test.cc: In function `int main(int, char **)':
* test.cc:40: too many arguments to function
*
* Note that because BadCallT.call is declared with an `extern "C"'
* linkage specification, the compiler is supposed to declare the
* function as able to take any arguments (much like OkayCallT, which
* works as expected). This error occurs even if the
* -fno-strict-prototype switch is used.
*
* The command used to cause this bug is:
* gcc -c test.cc
*/
extern "C"
{
typedef void (*OkayCallT)();
typedef struct
{
void (*call)();
} BadCallT;
}
int main(int argc, char* argv[])
{
OkayCallT okay;
BadCallT bad;
(*okay)(argc);
(*bad.call)(argc); // Line 40
}