51ac0ed7fd
GCC 15 treats empty parentheses as (void), conflicting with the actual lookup_element signature generated by gperf. This was intentionally done, as version 7.7 removed the arguments because gperf 3.0 generates `unsigned int` while gperf 3.1 generates `size_t`. However, gperf 3.1 is nearly 10 years old, so it's reasonable to assume that practically every system that wants to use GCC 15 will have gperf 3.1 or later. Nixpkgs uses gperf 3.3, so we use `size_t` in the prototype. This commit also adds gperf to `nativeBuildInputs` since patching the .hash file triggers regeneration of the C source. Fixes #480448
33 lines
1.4 KiB
Diff
33 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Amaan Qureshi <git@amaanq.com>
|
|
Date: Mon, 27 Jan 2026 00:00:00 -0500
|
|
Subject: [PATCH] Fix GCC 15 build by adding proper function prototype
|
|
|
|
GCC 15 treats empty parentheses as (void), conflicting with the actual
|
|
lookup_element signature generated by gperf. This was intentionally done,
|
|
as version 7.7 removed the arguments because gperf 3.0 generates `unsigned int`
|
|
while gperf 3.1 generates `size_t`. However, gperf 3.1 is nearly 10 years old,
|
|
so it's reasonable to assume that practically every system that wants
|
|
to use GCC 15 will have gperf 3.1 or later.
|
|
|
|
This patch uses `size_t` to match gperf 3.1.
|
|
|
|
---
|
|
dtd.hash | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/dtd.hash b/dtd.hash
|
|
--- a/dtd.hash
|
|
+++ b/dtd.hash
|
|
@@ -43,8 +43,8 @@ EXPORT typedef struct _ElementType {
|
|
} ElementType;
|
|
|
|
/* lookup_element -- look up the string in the hash table */
|
|
-EXPORT const ElementType * lookup_element(/* register const char *str,
|
|
- register unsigned int len */);
|
|
+EXPORT const ElementType * lookup_element(register const char *str,
|
|
+ register size_t len);
|
|
|
|
/* Different kinds of parent elements: */
|
|
#define PHRASE "abbr", "acronym", "b", "bdi", "bdo", "big", "cite", "code", "dfn", "em", "i", "kbd", "q", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "tt", "u", "var"
|