autoconf
[Top][All Lists]
Advanced

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

Problem with check for functions with Sun CC


From: Martin Frydl
Subject: Problem with check for functions with Sun CC
Date: Thu, 02 May 2002 16:01:48 +0200

I've made check for getcwd function and used the generated script with
Sun's CC compiler. It reports unexisting getcwd even if it really
exists. Here is what I've done:

configure.in (just generating config.h):

AC_INIT()
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_FUNCS(getcwd)
AC_CONFIG_HEADER(config.h)
AC_OUTPUT()

I've run configure as:

./configure CC=CC CXX=CC

When looking to config.log, there is this error:

"configure", line 2365: Error: Only one of a set of overloaded functions
can be extern "C".
"configure", line 2383: Warning (Anachronism): Assigning extern "C"
char(*)() to char(*)().
1 Error(s) and 1 Warning(s) detected.

The problem is that conftest.c includes stdlib.h via conftest.h. This
declares getcwd. conftest.c declares it second time as:

#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 getcwd ();

The compiler complains about extern "C". My question is whether this is
autoconf bug or should I use ./configure CC=cc CXX=CC to really use C
compiler for these tests. I'm using this:

CC: WorkShop Compilers 5.0 01/12/04 C++ 5.0 Patch 107311-16
cc: WorkShop Compilers 5.0 98/12/15 C 5.0
SunOS 5.7 Generic_106541-20 sun4u sparc SUNW,Ultra-60

Thanks for any response.

  Martin



reply via email to

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