The current code fails with gcc r16-2729-g0d276cd378e and
  -Werror=discarded-qualifiers -Werror=write-strings
(the -Werror=write-strings is useful to check compatibility of
user code with C++, and the -Werror=discarded-qualifiers is an
upgrade of a default warning to an error). Since this is a test
for C99, we may assume that const is supported by the compiler,
and adding const makes the code more robust in this context.

Signed-off-by: Vincent Lefevre <[email protected]>
---
 lib/autoconf/c.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index bafa72c1..4cdb2995 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1316,7 +1316,7 @@ ac_c_conftest_c99_main='
   // Check restrict.
   if (test_restrict ("String literal") == 0)
     success = true;
-  char *restrict newvar = "Another string";
+  const char *restrict newvar = "Another string";
 
   // Check varargs.
   success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
-- 
2.50.1


Reply via email to