-
Notifications
You must be signed in to change notification settings - Fork 254
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
Rely on libc
crate to further reduce imports?
#20
Comments
This is a good idea when the types match. In many cases, however, the A viable solution might be to continue doing computation at the C types but casting into |
I've started translating a rather large C project and this is my main pain point. Each generated file has an extensive amount of boilerplate that is identical across files and seems identical to what libc offers.
I attempted a |
This is something that we plan to do in the near future, but it's non-trivial because we have to take a conservative approach and make sure to replace header functions and types only when it's 100% correct, e.g., the signature of the transpiled function perfectly matches the one in the
You can mostly fix that with a few refactoring commands:
but The big issue with changing Edit: shortened the refactoring snippet. |
@ahomescu Yeah, I understand the burden that is maintaining semantics! It's a tall order. The refactoring tool looks very cool! But unfortunately I haven't been able to really find any documentation on it (eg #41 and the docs.rs builds https://docs.rs/crate/c2rust-refactor/0.13.0 haven't gone through). |
libc
crate to further reduce imports?
I'm not sure to what extent this is feasible in practice, but all of the files I'm getting out of c2rust have very large blocks of extern items that could mostly be elided by relying on the libc crate's definition for those type signatures. Would that tactic cause issues for the semantics-preserving approach you've taken?
The text was updated successfully, but these errors were encountered: