guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RedHat 7.1, snarfing, and C++.


From: Marius Vollmer
Subject: RedHat 7.1, snarfing, and C++.
Date: 20 Apr 2001 22:53:28 +0200
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

Hi,

people are having trouble with the C++ compiler in RedHat 7.1.  It
doesn't accept code like this:

    extern "C" void foo (int (*)());

    int
    bar1 (int x)
    {
      foo ((int (*)())bar1);
    }

    int
    bar2 (int x)
    {
      foo ((int (*)(...))bar2);
    }

It gives:

    test.cc: In function `int bar2 (int)':
    test.cc:12: cannot convert `int (*) (...)' to `int (*) ()' for argument
    `1' to `foo (int (*) ())'

[There are also two unrelated warnings which I removed for clarity.]

However, for C++, we explicitely create code like this

    scm_make_gsubr (s_dynblockp, 1, 0, 0, (SCM (*)(...)) sim_dynblockp);

from the snarfer.

Gcc-2.95.2 accepts the code above without any diagnostics.  RedHat 7.1
uses some post-2.96 version of gcc, I'm told.  I don't have RedHat 7.1
myself.  Details are upcoming.


Why do we need to use (*)(...) for C++ in snarf.h?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]