* "-Werror=c++-compat" triggers a failure due to stringized "and".
This is GCC bug 40564, which is not specific to C99 and later.
So it is useless to see this as not being conforming to C99.
* Avoid implicit pointer conversion from 'void *'.
---
lib/autoconf/c.m4 | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 3705d028..c94b5a05 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1212,7 +1212,9 @@ extern int dprintf (int, const char *, ...);
extern void *malloc (size_t);
extern void free (void *);
-// Check varargs macros. These examples are taken from C99 6.10.3.5.
+// Check varargs macros. These examples are taken from C99 6.10.3.5
+// with "and" replaced by "then" in showlist to avoid GCC bug 40564
+// on -Wc++-compat (which is not specific to C99 and later).
// dprintf is used instead of fprintf to avoid needing to declare
// FILE and stderr.
#define debug(...) dprintf (2, __VA_ARGS__)
@@ -1225,7 +1227,7 @@ test_varargs_macros (void)
int y = 5678;
debug ("Flag");
debug ("X = %d\n", x);
- showlist (The first, second, and third items.);
+ showlist (The first, second, then third items.);
report (x>y, "x is %d but y is %d", x, y);
}
@@ -1323,7 +1325,7 @@ ac_c_conftest_c99_main='
test_varargs_macros ();
// Check flexible array members.
- struct incomplete_array *ia =
+ struct incomplete_array *ia = (struct incomplete_array *)
malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
ia->datasize = 10;
for (int i = 0; i < ia->datasize; ++i)
--
2.50.1