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]

File "test.cc" demonstrating a bug in gcc 2.95 on SCO 5.0.5a


/*
 * 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
}



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