autoconf
[Top][All Lists]
Advanced

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

Problem with AC_CHECK_FUNC and compaq cxx in strict_ansi mode


From: Jean-Marc Lasgouttes
Subject: Problem with AC_CHECK_FUNC and compaq cxx in strict_ansi mode
Date: 22 Oct 2001 17:02:53 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.4

Hello,

I am compiling a C++ program (LyX) with compaq cxx 6.2 in strict ansi
mode. It happens that no C functions are found by autoconf 2.52
AC_CHECK_FUNC macro, because the program bug1.C (attached, taken from
what autoconf uses) produces:

fantomas: cxx -std strict_ansi bug1.C 
cxx: Error: bug1.C, line 22: a value of type "char (*)() C" cannot be
          assigned to an entity of type "char (*)()"
f = memmove;
--^
cxx: Info: 1 error detected in the compilation of "bug1.C".

[I get only a warning in 'ansi' mode]

The solution is to declare also f as 'extern "C"', as  done in bug2.C
(attached too). In this case, I only get the warning

fantomas: cxx -std strict_ansi bug2.C 
cxx: Warning: bug2.C, line 6: Expected type
          "void *(void *, const void *, unsigned long) C" is incompatible with
          declared type "char () C", function will not be made intrinsic
char memmove ();
-----^

but I presume this is not a problem.

Please let me know if you need more information on this. I'd be glad
to see this fixed in next release...

JMarc

Attachment: bug1.C
Description: Sample code which does not compile

Attachment: bug2.C
Description: Sample code which does compile


reply via email to

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