All function pointer types should be `Option<unsafe extern "C" fn(...) -> ...>`
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 1.3k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 69
Description
https://github.com/rust-lang/libc/issues/2198 falls into this category, and https://github.com/rust-lang/libc/pull/4341 fixes at least a subset. We should enforce this rule in the style.rs checks.
Three things here:
Optionbecause API may allow a null pointerunsafebecause functions may have side effects or be invalid pointers (https://github.com/rust-lang/libc/issues/4998 for a proposal to adjust the second part)extern "C"because that's what the C side expects
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the style.rs checks and the related examples in issue #2198 and pull request #4341. Extend the checks to enforce Option<unsafe extern "C" fn(...) -> ...> for all function pointer types, covering the nullability, safety, and calling-convention requirements described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100