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

>From e8703cf52d88e1c9833753cfa446b48394a0195b Mon Sep 17 00:00:00 2001
From: Peter Simons <sim...@cryp.to>
Date: Sat, 2 Jun 2018 13:32:25 +0200
Subject: [PATCH] lib/af_alg.c: 'for' loop initial declarations are only
 allowed in C99 mode

---
 lib/af_alg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/af_alg.c b/lib/af_alg.c
index ded4b326b..45df62c80 100644
--- a/lib/af_alg.c
+++ b/lib/af_alg.c
@@ -45,7 +45,8 @@ alg_socket (char const *alg)
     .salg_type = "hash",
   };
   /* Avoid calling both strcpy and strlen.  */
-  for (int i = 0; (salg.salg_name[i] = alg[i]); i++)
+  int i;
+  for (i = 0; (salg.salg_name[i] = alg[i]); i++)
     if (i == sizeof salg.salg_name - 1)
       return -EINVAL;
 
-- 
2.16.3

Reply via email to