[PATCH] Ensure current language is C when using AC_PROG_CC_C_O.

Nick Bowler <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Message-ID <[email protected]>
If the current language is not C, the AC_PROG_CC_C_O macro will never-
theless directly invoke the C compiler, but the file extensions used by
the tests will be appropriate for the current language setting rather
than for the C compiler.

In this case, the test may produce a false negative result if the C
compiler cares about input file extensions (for example, when using
the GNU Compiler Collection) or if the current language uses a
different object file extension than the C compiler.

* lib/autoconf/c.m4 (AC_PROG_CC_C_O): Add AC_LANG_ASSERT([C]) to help
avoid possible false negatives.
---
 lib/autoconf/c.m4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index affd765..fcc5c88 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -589,6 +589,7 @@ fi
 # --------------
 AC_DEFUN([AC_PROG_CC_C_O],
 [AC_REQUIRE([AC_PROG_CC])dnl
+AC_LANG_ASSERT([C])dnl
 if test "x$CC" != xcc; then
   AC_MSG_CHECKING([whether $CC and cc understand -c and -o together])
 else
-- 
1.8.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.