summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-08-31 23:16:06 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-08-31 23:16:41 -0700
commit54c726aa5c0414148d03059c1bce14baaa0c7c09 (patch)
tree40801fb074d2a5fd21c0281ab75c4c22af0ca96b
parent96cdf32954a64884ef28da1e384de5dae49d94e0 (diff)
downloadautoconf-54c726aa5c0414148d03059c1bce14baaa0c7c09.tar.gz
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>.
-rw-r--r--ChangeLog14
-rw-r--r--lib/autoconf/c.m417
2 files changed, 23 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e36455c..1e17e609 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+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
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index e4b807b6..88785d1e 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1660,11 +1660,11 @@ esac
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;
@@ -1681,8 +1681,9 @@ AC_DEFUN([AC_C_CONST],
++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;
@@ -1698,10 +1699,10 @@ AC_DEFUN([AC_C_CONST],
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;