Any reason why the `#[exception]` macro disallows `extern "C" fn`s?
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- rust
- 领域
- embedded-iot
调研方向
首先检查 #[exception] 宏的签名验证,并将其与 #[pre_init] 宏对 unsafe naked 函数和 ABI 的处理进行比较。确定 HardFault 处理程序是否应接受 extern "C",并通过有针对性的宏测试验证行为,包括当前签名显示的警告。
由索引模型根据 Issue 内容生成。
描述
I have the following signature for my HardFault handler:
#[exception(trampoline = false)]
#[naked]
unsafe fn HardFault() -> ! {
...
This triggers the compiler warning
warning: Rust ABI is unsupported in naked functions
note:#[warn(undefined_naked_function_abi)]on by default
Which could be avoided by modifying the signature to be:
#[exception(trampoline = false)]
#[naked]
unsafe extern "C" fn HardFault() -> ! {
...
But this is not accepted by the macro:
HardFaulthandler must have signatureunsafe fn() -> !
Is there any reason for the macro to not allow specifying the ABI?
Also, could someone point me as to why does the following not produce the same warning?
#[pre_init]
#[naked]
unsafe fn pre_init() {
...
- 主要语言
- Rust
- 星标
- 1k
- 派生
- 201
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rust-embedded/cortex-m 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
rust-embedded/cortex-m#651 · 5 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
rust-embedded/cortex-m#637 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
rust-embedded/cortex-m#511 · 2 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 55/100
rust-embedded/cortex-m#700 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
rust-embedded/cortex-m#695 ·
查看 rust-embedded/cortex-m 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
dsx-ai-factory/infra-controller#8341 ·
维护者通常 1 天内回复
-
enhancement triage:deciding
难度 2/5 1-3 小时 新手友好度 70/100
open-telemetry/otel-arrow#4540 ·
维护者通常 2 天内回复
-
benchmark: CSV report files contain blank records on Windows可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭component:benchmark
难度 2/5 1-3 小时 新手友好度 76/100
agentic-os-org/ANOLISA#9177 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
oracle/rust-oracledb#61 ·
-
bug priority-medium to-agent
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复