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

Facing transpilation issues around Atomic #832

Closed
mahajpuneet opened this issue Feb 14, 2023 · 4 comments
Closed

Facing transpilation issues around Atomic #832

mahajpuneet opened this issue Feb 14, 2023 · 4 comments

Comments

@mahajpuneet
Copy link

Hi team,

Trying to use c2rust, but noticing these issues:

--> /usr/lib/llvm-11/lib/clang/11.0.1/include/stdatomic.h:107:1 [-Wclang-ast] thread 'main' panicked at 'Unsupported implicit cast: AtomicToNonAtomic', /home/debian/.cargo/registry/src/github.com-1ecc6299db9ec823/c2rust-transpile-0.17.0/src/c_ast/conversion.rs:165:14

Could you please advise? Thanks in advance

@thedataking
Copy link
Contributor

C11 atomics are not fully supported so what you are seeing is expected. We do have a highly experimental branch that you can try out #814 which may translate the input that triggers the above error. Since the branch is WIP, please audit the output Rust carefully and expect errors.

@mahajpuneet
Copy link
Author

Sure @thedataking, thank you. Sorry, is this branch likely to be merged perhaps in a month or two? Can wait

@thedataking
Copy link
Contributor

thedataking commented Feb 14, 2023

Adding support for C11 atomics is not high priority so unfortunately, I do not have a timeframe for merging it in. If you are translating an open source project, let me know which one; I can try to see if the branch handles all items you need.

@mahajpuneet
Copy link
Author

mahajpuneet commented Feb 14, 2023

ah yes trying to see for a modified code base of Redis (added some changes on top of my own to work better with c2rust)

I did try the branch as you suggested. Got this also(just checking if this too will come into the branch as and when it gets merged):

error: Failed to translate config: Unsupported default initializer: Atomic(CQualTypeId { qualifiers: Qualifiers { is_const: false, is_restrict: false, is_volatile: false }, ctype: CTypeId(15) })

Previous error did get fixed and a lot more files got transpiled this time, so thank you !!

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

2 participants