diff options
author | Zack Weinberg <zackw@panix.com> | 2020-11-09 13:08:13 -0500 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-11-09 13:10:46 -0500 |
commit | a8b69e68aa2c96ad8b93822e462719d59d69025a (patch) | |
tree | a6c61e265ea41ee05dd3947f0c364d08bd9e259c /lib | |
parent | 8e5401395857f1acae558a5e926bad6609580fae (diff) | |
download | autoconf-a8b69e68aa2c96ad8b93822e462719d59d69025a.tar.gz |
Fix more bugs in specific tests under AC_LANG(C++).
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++.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/autoconf/c.m4 | 4 | ||||
-rw-r--r-- | lib/autoconf/programs.m4 | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index ca63dc58..a31d2d33 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -1993,8 +1993,8 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER], #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], diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4 index b352ce24..63e07043 100644 --- a/lib/autoconf/programs.m4 +++ b/lib/autoconf/programs.m4 @@ -747,6 +747,9 @@ fi])]) AC_DEFUN([_AC_PROG_LEX_YYTEXT_DECL], [cat >conftest.l <<_ACEOF[ %{ +#ifdef __cplusplus +extern "C" +#endif int yywrap(void); %} %% |