Suppose we have something like
AC_CHECK_FUNCS([setitimer], [], AC_MSG_ERROR([...]))
then autoconf (version 2.54c and previous ones) tries to compile a
program containing (inessential lines snipped)
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char setitimer ();
char (*f) ();
int
main ()
{
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_setitimer) || defined (__stub___setitimer)
choke me
#else
f = setitimer;
#endif
The problem is with the assignment `f = setitimer;' in case we are
using a standard conforming (strictly speaking) C++ compiler. In
fact, in standard C++, a value of type "char (*)() C" (a C function)
cannot be assigned to an entity of type "char (*)()" (a C++ function).
The fix is easy: it suffices to change autoconf so that, instead
of generating
------------------------------------------------------------------
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char setitimer ();
char (*f) ();
------------------------------------------------------------------
it produces
------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char setitimer ();
char (*f) ();
#ifdef __cplusplus
}
#endif
------------------------------------------------------------------
so that, in C++, both `f' and `setitimer' have C linkage.
All the best
Roberto
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it
Dear all,
you have probably noticed that the branch called `lazy'
has just been created. It will be devoted to that part
of the development dealing with the incorporation of
lazy and incremental computation techniques.
To check out your copy of the branch:
1) go to a suitable, empty directory (choose a name that
minimizes your chances of confusing the `lazy' branch
with other branches or with the main trunk);
2) cvs -d cvs.cs.unipr.it:/cvs/ppl checkout -r lazy ppl
All the best
Roberto
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it