Re: Fix lib/af_alg.c compilation error on Ubuntu Trusty

2018-06-03 Thread Paul Eggert

Peter Simons wrote:

gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 will not compile this file
without this patch.


What's the context for this? What package are you building, what options to 
'configure' did you use, and what 'gcc' options are present? As I recall, GCC 
4.8.4 works just fine with for-loop declarations, unless you specify parameters 
saying "I want old-fashioned C".




Re: Fix lib/af_alg.c compilation error on Ubuntu Trusty

2018-06-03 Thread Peter Simons
Hi Paul,

 > Peter Simons wrote:
 >> gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 will not compile this file
 >> without this patch.
 >
 > What's the context for this?

I believe that https://travis-ci.org/peti/mapson/builds/386553484 has
all the information you'll want.

Best regards,
Peter



Re: Fix lib/af_alg.c compilation error on Ubuntu Trusty

2018-06-03 Thread Paul Eggert

Peter Simons wrote:


https://travis-ci.org/peti/mapson/builds/386553484


Thanks, that provides helpful context. I'd rather not limit Gnulib C files to 
C89 syntax here, though, as support for the C99 syntax ought to be universal 
nowadays. How about the attached patch instead? I installed it in the hope that 
it solves the problem on your platform.
>From 7ff7a27a8a988a5aa058ce29e1e219e4fa75940f Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Sun, 3 Jun 2018 18:02:10 -0700
Subject: [PATCH] Port crypto/af_alg to GCC 4.8.4

Problem reported by Peter Simons in:
https://lists.gnu.org/r/bug-gnulib/2018-06/msg2.html
* modules/crypto/af_alg (Depends-on): Add c99 if USE_AF_ALG.
---
 ChangeLog | 7 +++
 modules/crypto/af_alg | 1 +
 2 files changed, 8 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index b23b109..1104876 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-06-03  Paul Eggert  
+
+	Port crypto/af_alg to GCC 4.8.4
+	Problem reported by Peter Simons in:
+	https://lists.gnu.org/r/bug-gnulib/2018-06/msg2.html
+	* modules/crypto/af_alg (Depends-on): Add c99 if USE_AF_ALG.
+
 2018-05-27  Colin Watson  
 
 	bootstrap: document source fetching in --help
diff --git a/modules/crypto/af_alg b/modules/crypto/af_alg
index 519bab7..2ad25fe 100644
--- a/modules/crypto/af_alg
+++ b/modules/crypto/af_alg
@@ -8,6 +8,7 @@ lib/sys-limits.h
 m4/af_alg.m4
 
 Depends-on:
+c99 [test $USE_AF_ALG = 1]
 fseeko  [test $USE_AF_ALG = 1]
 ftello  [test $USE_AF_ALG = 1]
 sys_socket
-- 
2.7.4



Re: Fix lib/af_alg.c compilation error on Ubuntu Trusty

2018-06-03 Thread Peter Simons
Hi Paul,

 > How about the attached patch instead?

yes, that patch fixes the build on travis-ci. Thank you very much for
your help!

Best regards,
Peter