canard.c 5.0.0: static random() conflicts with newlib's random() (fails to build on ESP-IDF)
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 86/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- c
- 领域
- embedded-iot
调研方向
打开canard.c,检查random()的定义及其三个调用位置,包括chance()中的调用。使用报告中的idf.py build命令,在包含libcanard 5.0.0的ESP-IDF项目中重现构建失败。当组件在没有冲突的random()声明的情况下构建成功时,即为完成。
由索引模型根据 Issue 内容生成。
描述
canard.c in v5.0.0 defines static uint64_t random(canard_t* const self, const uint64_t bound)
(line 130). On ESP-IDF this fails to compile because newlib's <stdlib.h> declares
long random(void);, and it is pulled in indirectly by the headers canard.c includes.
v4.0.0 has no function with this name. This breaks the ESP registry package
opencyphal/libcanard 5.0.0.
Error (ESP-IDF v5.3.1, gcc 13.2.0, -std=gnu17 -D_GNU_SOURCE):
canard.c:130:17: error: conflicting types for 'random'; have 'uint64_t(canard_t * const, const uint64_t)'
Reproduce: in an ESP-IDF project add opencyphal/libcanard: "^5.0.0" to
main/idf_component.yml and run idf.py build.
Suggested fix: rename the helper, e.g. to canard_random. It appears 4 times in
canard.c: lines 130 (definition), 136 (chance()), 1933 and 1988. A new release would be
needed for the ESP registry package to pick it up.
- 主要语言
- C
- 星标
- 451
- 派生
- 220
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
area/docs
难度 1/5 1 小时以内 新手友好度 83/100
Clodmony/starship-coop#72 ·
维护者通常 1 天内回复
-
ospf6d: heap-use-after-free in seqnumber_mismatch()/bad_lsreq() when a neighbor is deleted with events pending可能已有人在做 @lichenlang89 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 61/100
维护者通常 2 天内回复
-
5700模组网络优先级问题未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
severity: low
难度 2/5 1-3 小时 新手友好度 76/100
luainkernel/lunatik#2372 ·
维护者通常 1 天内回复