Skip to content

Change the type of LLVM Message pointer to libc :: c_char #8

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

Merged
merged 2 commits into from
Jan 21, 2022

Conversation

ken109
Copy link
Contributor

@ken109 ken109 commented Dec 7, 2021

When I tried to install it on Ubuntu, I got the following error.

error[E0308]: mismatched types
  --> src/llvm/message.rs:34:36
   |
34 |                 LLVMDisposeMessage(self.ptr);
   |                                    ^^^^^^^^ expected `u8`, found `i8`
   |
   = note: expected raw pointer `*mut u8`
              found raw pointer `*mut i8`

error[E0308]: mismatched types
  --> src/llvm/message.rs:43:52
   |
43 |             let contents = unsafe { CStr::from_ptr(self.ptr).to_str().unwrap() };
   |                                                    ^^^^^^^^ expected `u8`, found `i8`
   |
   = note: expected raw pointer `*const u8`
              found raw pointer `*mut i8`

// Many others

The reason was that the arguments of LLVMDisposeMessage and LLVMCreateBinary are libc :: c_char type instead of i8 type.

Copy link
Collaborator

@alessandrod alessandrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you and sorry for the wait! This slipped under my radar. See my comments.

@ken109
Copy link
Contributor Author

ken109 commented Jan 11, 2022

@alessandrod
Fixed!

@ken109 ken109 requested a review from alessandrod January 21, 2022 10:56
@alessandrod alessandrod merged commit e5fb246 into aya-rs:main Jan 21, 2022
@alessandrod
Copy link
Collaborator

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

Successfully merging this pull request may close these issues.

2 participants