+2011-08-31 Paul Eggert <eggert@cs.ucla.edu>
+
+ AC_C_CONST: don't reject gcc -Werror -Wall
+ * lib/autoconf/c.m4 (AC_C_CONST): Don't reject gcc when it is used
+ with -Werror -Wall during configuring. It's unwise to use GCC
+ that way, but apparently enough people do it nowadays that it's an
+ issue. These days nobody uses the old compilers that the old
+ tests reject, so we can't test this fix against them, but it's
+ more important to work with modern GCC (even when misused) than to
+ work with no-longer-used compilers. Problem reported by Shevek in
+ <http://lists.gnu.org/archive/html/bug-autoconf/2008-11/msg00007.html>
+ and raised again by Dan Kegel in
+ <http://lists.gnu.org/archive/html/bug-autoconf/2011-08/msg00020.html>.
+
2011-08-16 Stefano Lattarini <stefano.lattarini@gmail.com>
docs: other issues with parallel BSD make
AC_DEFUN([AC_C_CONST],
[AC_CACHE_CHECK([for an ANSI C-conforming const], ac_cv_c_const,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
-[[/* FIXME: Include the comments suggested by Paul. */
+[[
#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
+ /* Ultrix mips cc rejects this sort of thing. */
typedef int charset[2];
- const charset cs;
+ const charset cs = { 0, 0 };
/* SunOS 4.1.1 cc rejects this. */
char const *const *pcpcc;
char **ppc;
++pcpcc;
ppc = (char**) pcpcc;
pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
iptr p = 0;
++p;
}
- { /* AIX XL C 1.02.0.0 rejects this saying
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;