summarylogtreecommitdiffstats
path: root/0007-replace-initialized-constant-with-define-statement.patch
blob: 0a2bc9dd6cb2d012900f45b24afd265def5780e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Fabian Groffen <grobian@gentoo.org>
Date: Sat, 16 Jul 2022 21:34:13 +0200
Subject: [PATCH 07/19] replace initialized constant with #define statement

GCC doesn't like this:

filetree.c:744:9: error: variable-sized object may not be initialized

Since there's nothing changing at runtime at all, just make the compiler
see it's always going to be 1.

Patch-Source: https://github.com/gentoo/gentoo/blob/dce914f2bbf52360f45c90d877857df3c4c2a353/app-arch/xar/files/xar-1.8.0.0.487-variable-sized-object.patch
---
 xar/lib/filetree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xar/lib/filetree.c b/xar/lib/filetree.c
index f31682a..9c30c03 100644
--- a/xar/lib/filetree.c
+++ b/xar/lib/filetree.c
@@ -752,7 +752,7 @@ int xar_file_equals_file(xar_file_t f1, xar_file_t f2)
 	size_t fspath1_size = 0, fspath2_size = 0;
 	size_t ns1_size = 0, ns2_size = 0;
 	const struct __xar_file_t * child1 = NULL, * child2 = NULL;
-	const uint keys_to_ignore_count = 1;
+#define keys_to_ignore_count 1
 	char * keys_to_ignore[keys_to_ignore_count] = { "id" }; // ID is allowed ot mismatch
 	
 	// If the two pointers match, call it the same.
-- 
2.44.1