| Hi,
Hi!
CCed to Autoconf because there is an issue which we'll need to discuss
(again).
| the appended patch fixes some tests to produce correct results even
| if compiled with the stricter checking of g++ >= 2.95.
OK, you do speak of a C++ compiler and C tests :) Are you using
CC=g++? Under what conditions do you meet this problems?
| BTW, config.guess and config.sub need synchronizing with the main repository.
I think so to, but I don't know where the main repo is :(
We need a ChangeLog.
| Index: acspecific.m4
| ===================================================================
| RCS file: /cvs/autoconf/acspecific.m4,v
| retrieving revision 1.223
| diff -u -p -r1.223 acspecific.m4
| --- acspecific.m4 2000/02/25 13:19:36 1.223
| +++ acspecific.m4 2000/02/29 19:24:17
| @@ -1353,6 +1353,11 @@ AC_CACHE_CHECK(for working mmap, ac_cv_f
|
| #ifdef __cplusplus
| extern "C" { void *malloc(unsigned); }
| +extern "C" { int rand(void); }
| +extern "C" { int umask(int); }
Could you factor the extern "C" please? A space before the the
parens. Better yet: shouldn't some headers be included?
| +# ifdef HAVE_UNISTD_H
| +# include <unistd.h>
| +# endif
| #else
| char *malloc();
| #endif
| @@ -1367,7 +1372,7 @@ main ()
| pagesize = getpagesize ();
|
| /* First, make a file with some known garbage in it. */
| - data = malloc (pagesize);
| + data = (char *) malloc (pagesize);
| if (!data)
| exit (1);
| for (i = 0; i < pagesize; ++i)
| @@ -1386,7 +1391,7 @@ main ()
| fd = open ("conftestmmap", O_RDWR);
| if (fd < 0)
| exit (1);
| - data2 = malloc (2 * pagesize);
| + data2 = (char*) malloc (2 * pagesize);
| if (!data2)
| exit (1);
| data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
| @@ -1402,7 +1407,7 @@ main ()
| some variants of i386 svr4.0.) */
| for (i = 0; i < pagesize; ++i)
| *(data2 + i) = *(data2 + i) + 1;
| - data3 = malloc (pagesize);
| + data3 = (char*) malloc (pagesize);
| if (!data3)
| exit (1);
| if (read (fd, data3, pagesize) != pagesize)
| @@ -1695,7 +1700,7 @@ AC_DEFUN(AC_FUNC_ALLOCA,
| # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
| # for constant arguments. Useless!
| AC_CACHE_CHECK([for working alloca.h], ac_cv_working_alloca_h,
| -[AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));],
| +[AC_TRY_LINK([#include <alloca.h>], [char *p = (char *) alloca(2 * sizeof(int));],
I'd put a line break here, and spaces before the parens.
| ac_cv_working_alloca_h=yes, ac_cv_working_alloca_h=no)])
| if test $ac_cv_working_alloca_h = yes; then
| AC_DEFINE(HAVE_ALLOCA_H, 1,
| @@ -2534,7 +2539,7 @@ AC_CACHE_CHECK([for an ANSI C-conforming
| #ifndef __cplusplus
| /* Ultrix mips cc rejects this. */
| typedef int charset[2];
| - const charset x;
| + const charset x = {0,0};
| /* SunOS 4.1.1 cc rejects this. */
| char const *const *ccp;
| char **p;
OK, now we come the ``it''. We've already had a long thread on this
very issue, and it has been decided *not* to do that, because it is
perfect C not to initial a const var. Hence, no reason to weaken the
test. The only problem was with CC=g++, for which it is indeed
invalid, but this piece of the test is conditioned out for C++.
Could you give more details on the failure you address?
Akim