rust-lang / rust-lang/rust-bindgen
long double becomes u128
Open
Nobody has claimed this yet.
enhancement
help wanted
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
Input C/C++ Header
typedef long double foo
Bindgen Invocation
$ bindgen input.h
Actual Results
/* automatically generated by rust-bindgen */
pub type a = u128;
Expected Results
I'm not entirely sure. Here are the idea's I can think of
- use f64, but that leeds to it's own set of issues (#1529).
- use the
f128crate but the layout of thef128is different to the layout of a clong double - add a
c_longdoubletype tostd::os::raw. The problem is that on many machines (including mine)long doubleis a 16 byte float, which rust doesn't suport - Through an error. This will avoid confusion, but also make also will mean losing suport for many .h files
- use u128. The problem here is were treating a float as an int, and that will mean all sorts of problems
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 reproducing the issue with the shown input.h and bindgen invocation, then read the discussion around the listed expected-result options and issue #1529. Done means the project has an agreed, tested handling for C/C++ long double that avoids silently representing it as u128.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp, rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100