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

Cannot compile for 32-bit #3

Closed
opensourcegeek opened this issue Apr 2, 2017 · 2 comments
Closed

Cannot compile for 32-bit #3

opensourcegeek opened this issue Apr 2, 2017 · 2 comments

Comments

@opensourcegeek
Copy link

I get the following errors when I tried to cross-compile for 32-bit arch.

error[E0512]: transmute called with differently sized types: usize (32 bits) to [u8; 8] (64 bits)
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/snmp-0.2.1/src/lib.rs:290:42
    |
290 |                     let bytes = unsafe { mem::transmute::<usize, [u8; 8]>(len.to_be()) };
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ transmuting between 32 bits and 64 bits

error[E0512]: transmute called with differently sized types: [u8; 8] (64 bits) to usize (32 bits)
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/snmp-0.2.1/src/lib.rs:726:30
    |
726 |                 o = unsafe { mem::transmute::<[u8; 8], usize>(bytes).to_be()};
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ transmuting between 64 bits and 32 bits

error: aborting due to 2 previous errors

error: Could not compile `snmp`.

Please let me know if you need more logs etc.

hroi added a commit that referenced this issue Apr 5, 2017
Untested.
Reported by @opensourcegeek in issue #3.
@hroi
Copy link
Owner

hroi commented Apr 5, 2017

Thanks for reporting this.
Could you test the attempted fix for me?

@hroi hroi mentioned this issue Apr 5, 2017
Closed
@opensourcegeek
Copy link
Author

Thanks for getting back - I tried to compile against your master and it compiles fine for i686-unknown-linux-musl target.

usbalbin pushed a commit to usbalbin/rust-snmp that referenced this issue Jan 21, 2020
Added error handling to pdu and its users
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