Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement struct bit-fields #75

Open
meagon opened this issue Oct 4, 2016 · 2 comments
Open

implement struct bit-fields #75

meagon opened this issue Oct 4, 2016 · 2 comments

Comments

@meagon
Copy link

meagon commented Oct 4, 2016

("/usr/include/x86_64-linux-gnu/bits/timex.h": line 50): Corrode doesn't handle this yet:
    int : 32

while file like:

struct timex {
...
  int tai;          /* TAI offset (ro) */

  /* ??? */
  int  :32; int  :32; int  :32; int  :32;
  int  :32; int  :32; int  :32; int  :32;
  int  :32; int  :32; int  :32;
};
@meagon meagon changed the title doest not handle strauct with bit-field doest not handle struct with bit-field Oct 4, 2016
@jameysharp jameysharp changed the title doest not handle struct with bit-field implement struct bit-fields Oct 11, 2016
@jameysharp
Copy link
Owner

I have no idea yet what bit-fields should translate to in Rust, so if anyone has suggestions I'd love to hear them!

That said, I think we'll get a long way with #71, which should allow us to translate headers declaring types we don't know how to translate as long as those types aren't actually used in the current translation unit. This struct timex, for example, appears to be a Linux-specific type intended only for use by software like an NTP daemon, so I don't think much software is actually using it. Therefore, fixing #71 will probably get you past this error (and many like it) even if we don't implement bit-fields yet.

@burdges
Copy link

burdges commented Oct 11, 2016

There is an old but open Rust RFC issue rust-lang/rfcs#314 for discussing this, as well as a postponed proposal rust-lang/rfcs#1449 that seemingly got close but nothing ready to roll.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants