From 3ddabd9afeb2658252ca5e89981c32de7145791c Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Wed, 17 Jan 2018 22:03:45 +0000
Subject: Do not use __GNUC_PATCHLEVEL__ if it's not defined.


diff --git a/lib/includes/libtasn1.h b/lib/includes/libtasn1.h
index fc695a2..be25989 100644
--- a/lib/includes/libtasn1.h
+++ b/lib/includes/libtasn1.h
@@ -100,7 +100,11 @@ extern "C"
 
 
 # if defined __GNUC__ && !defined ASN1_INTERNAL_BUILD
+# if defined(__GNUC_PATCHLEVEL)
 #  define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+# else
+# define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
+# endif
 #  if _ASN1_GCC_VERSION >= 30100
 #   define _ASN1_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__))
 #  endif
-- 
2.30.2


From dbb27a921fb012e728b4ba946752e69d511434f8 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 10 Sep 2019 21:17:44 +0200
Subject: gcc2 build fix


diff --git a/fuzz/corpus2array.c b/fuzz/corpus2array.c
index f2a503b..8e7b89b 100644
--- a/fuzz/corpus2array.c
+++ b/fuzz/corpus2array.c
@@ -136,7 +136,9 @@ main (void)
 	      add = 1;
 	    }
 
-	  for (int i = 8; i < 32; i++)
+{
+	int i;
+	  for (i = 8; i < 32; i++)
 	    {
 	      if ((e.type & (1U << i)) && typename[i - 8])
 		{
@@ -144,7 +146,7 @@ main (void)
 		  add = 1;
 		}
 	    }
-
+}
 	  if (!add)
 	    printf (", %u", e.type);
 	}
diff --git a/lib/gl/strverscmp.c b/lib/gl/strverscmp.c
index 2dcf359..fe0e5f2 100644
--- a/lib/gl/strverscmp.c
+++ b/lib/gl/strverscmp.c
@@ -73,6 +73,7 @@ __strverscmp (const char *s1, const char *s2)
   if (p1 == p2)
     return 0;
 
+{
   unsigned char c1 = *p1++;
   unsigned char c2 = *p2++;
   /* Hint: '0' is a digit too.  */
@@ -108,5 +109,6 @@ __strverscmp (const char *s1, const char *s2)
       return state;
   }
 }
+}
 libc_hidden_def (__strverscmp)
 weak_alias (__strverscmp, strverscmp)
diff --git a/src/gl/malloc.c b/src/gl/malloc.c
index 0d8b359..09a9f88 100644
--- a/src/gl/malloc.c
+++ b/src/gl/malloc.c
@@ -40,6 +40,7 @@ rpl_malloc (size_t n)
       return NULL;
     }
 
+{
   void *result = malloc (n);
 
 #if !HAVE_MALLOC_POSIX
@@ -49,3 +50,4 @@ rpl_malloc (size_t n)
 
   return result;
 }
+}
diff --git a/src/gl/malloca.c b/src/gl/malloca.c
index b488423..c3d2337 100644
--- a/src/gl/malloca.c
+++ b/src/gl/malloca.c
@@ -61,6 +61,7 @@ mmalloca (size_t n)
              theoretical platforms where UINTPTR_MAX <= INT_MAX.  */
           INT_ADD_WRAPV (umem, sizeof (small_t) + sa_alignment_max - 1,
                          &umemplus);
+{
           idx_t offset = ((umemplus & ~alignment2_mask)
                           + sa_alignment_max - umem);
           void *vp = mem + offset;
@@ -73,6 +74,7 @@ mmalloca (size_t n)
           p[-1] = offset;
           /* p ≡ sa_alignment_max mod 2*sa_alignment_max.  */
           return p;
+}
         }
     }
   /* Out of memory.  */
-- 
2.30.2

