[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[again] Problem with AC_CHECK_FUNC and compaq cxx in strict_ansi mode
From: |
Jean-Marc Lasgouttes |
Subject: |
[again] Problem with AC_CHECK_FUNC and compaq cxx in strict_ansi mode |
Date: |
08 Nov 2001 15:21:15 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.4 |
[I sent a similar message a couple weeks ago, but since I got no
answer, I'll try to paraphrase it]
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 normal 'ansi' mode (but I cannot compile LyX
in ansi mode, so...)
The solution is to declare also f as 'extern "C"'.In this case, I only
get the warning (which is probably not a problem)
fantomas: cxx -std strict_ansi bug1.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 ();
-----^
Here is a proposed patch I use to be able to compile LyX with cxx 6.2.
It just changes AC_LANG_FUNC_LINK_TRY(C) to add an extra extern "C"
when needed. I tested it with g++ 2.95.2 nd got no problem.
Please let me know if you need more information on this. I'd be
grateful to see this fixed in next release.
JMarc
bug1.C
Description: Small program demonstrating the error
patch-autoconf
Description: Proposed patch
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [again] Problem with AC_CHECK_FUNC and compaq cxx in strict_ansi mode,
Jean-Marc Lasgouttes <=