Found by exhaustive testing for differences between probe results
under AC_LANG(C) and AC_LANG(C++).
* lib/autoconf/c.m4 (AC_C_FLEXIBLE_ARRAY_MEMBER): Cast result of
malloc for C++ compatibility.
* lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL): Declare yywrap
as extern "C" when compiling as C++.
#include <stddef.h>
struct s { int n; double d[]; };]],
[[int m = getchar ();
- struct s *p = malloc (offsetof (struct s, d)
- + m * sizeof (double));
+ struct s *p = (struct s *) malloc (offsetof (struct s, d)
+ + m * sizeof (double));
p->d[0] = 0.0;
return p->d != (double *) NULL;]])],
[ac_cv_c_flexmember=yes],
AC_DEFUN([_AC_PROG_LEX_YYTEXT_DECL],
[cat >conftest.l <<_ACEOF[
%{
+#ifdef __cplusplus
+extern "C"
+#endif
int yywrap(void);
%}
%%