Using the correct type of sighandler_t windows
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 1.3k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 69
Description
I'm opening this here as continuation of discussion on #1626. This also might be related to #1359.
Currently, sighandler_t is an alias to usize on Windows targets. While this works, it is strictly speaking wrong and the right type should be something like Option<extern "C" fn(c_int) -> ()>.
There are, however, concerns about the switch:
- It is an API change that might break someone's code. At least a crater run would be needed.
- What is the correct type? Due to the fact this doesn't always contain a valid function pointer, but also some marker constants (eg.
SIG_IGN, which has value of 1), it is unclear if this is correct on the Rust side. It seems the consensus is function pointers need to be non-null (solved by the Option) and properly aligned, but the alignment of function pointer on all platforms Windows currently run is 1, so for that reason this should be fine.
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 discussion in #1626 and the related issue #1359, then inspect the Windows definition of sighandler_t. Check how function pointers and marker constants such as SIG_IGN are represented, and assess the API impact, including whether a crater run is needed. Done means the correct type and a compatible change path are agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100