v26.06.9 not compiling on FreeBSD 15.1 (ccan/ccan/asort/asort.h with a solution)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 66/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- c
- 领域
- build-system
调研方向
冲突位于 ccan/ccan/asort/asort.h,其中本地的 qsort_r 声明与 FreeBSD 15.1 的 /usr/include/stdlib.h 所定义的宏发生冲突。请先阅读该头文件中 GNU 签名的分支,然后在 FreeBSD 上编译 ccan/ccan/asort/asort.c 以复现问题(Makefile 第 1106 行的规则会失败)。完成标准是:该文件能在 FreeBSD 15.1 上编译,并且在 Linux 上仍能构建,Linux 使用 GNU 版的 qsort_r 声明。在采用报告者提出的 __FreeBSD_version 守卫之前,请先将其与 FreeBSD 实际的签名进行核对。
由索引模型根据 Issue 内容生成。
描述
A recent change in ccan/ccan/asort/asort.h makes v26.06.9 not compilable on FreeBSD 15.1:
cc ccan/ccan/asort/asort.c
In file included from ccan/ccan/asort/asort.c:1:
ccan/ccan/asort/asort.h:30:6: error: expected identifier or '('
30 | void qsort_r(void *base, size_t nmemb, size_t size,
| ^
/usr/include/stdlib.h:367:5: note: expanded from macro 'qsort_r'
367 | __generic(arg5, int (*)(void *, const void *, const void *), \
| ^
/usr/include/sys/cdefs.h:228:2: note: expanded from macro '__generic'
228 | _Generic(expr, t: yes, default: no)
| ^
1 error generated.
gmake: *** [Makefile:1106: ccan-asort.o] Error 1
I think you might need something like this:
diff --git a/ccan/ccan/asort/asort.h b/ccan/ccan/asort/asort.h
index 4f5ab2402..d30e65a61 100644
--- a/ccan/ccan/asort/asort.h
+++ b/ccan/ccan/asort/asort.h
@@ -4,6 +4,7 @@
#include "config.h"
#include <ccan/order/order.h>
#include <stdlib.h>
+#include <sys/param.h>
/**
* asort - sort an array of elements
@@ -27,8 +28,10 @@ _asort((base), (num), sizeof(*(base)), \
* first libc include — we can't control our includers, so declare it
* ourselves (the configurator only sets this where this GNU signature
* was detected). */
+#if !defined(__FreeBSD__) || __FreeBSD_version < 1400000
void qsort_r(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *, void *), void *arg);
+#endif
#define _asort(b, n, s, cmp, ctx) qsort_r(b, n, s, cmp, ctx)
#else
void _asort(void *base, size_t nmemb, size_t size,
- 主要语言
- C
- 星标
- 3.1k
- 派生
- 1k
- 平均合并
- 4 天 4 小时
- 30 天内合并 PR
- 27
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ElementsProject/lightning 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
ElementsProject/lightning#9634 ·
维护者通常 1 天内回复
-
plugins/recover: missing comma in nodes_for_gossip concatenates two bootstrap addresses into invalid address可能已有人在做 @bhuvan-somisetty 于 3 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
ElementsProject/lightning#9630 ·
维护者通常 1 天内回复
-
common/json_parse: json_to_bitcoin_amount fails to detect overflow and accepts negative/empty inputs可能已有人在做 @bhuvan-somisetty 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
ElementsProject/lightning#9617 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
ElementsProject/lightning#9593 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
ElementsProject/lightning#9322 ·
维护者通常 1 天内回复
查看 ElementsProject/lightning 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
OpenPrinting/cups#1772 ·
维护者通常 1 天内回复
-
tech-debt
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 82/100
antoxa2584x/nfsu2-sw#44 · 1 个 reaction ·
维护者通常 1 天内回复